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 |
|---|---|---|---|---|---|---|---|
JavaScript | UTF-8 | 496 | 2.640625 | 3 | [] | no_license | ////////////////////////////////////////////////
// FUNCION DE SETEO DE DATOS EN LOCAL STORAGE //
////////////////////////////////////////////////
function setLocalStorage (key, list) {
var gettedData = localStorage.getItem(key)
var parsedData = JSON.parse(gettedData)
if (parsedData == null) {
par... |
PHP | UTF-8 | 4,876 | 2.78125 | 3 | [] | no_license | <?php
class Inspecciones{
public $IS_lector;
public $IS_sector;
public $IS_Hruta;
public $IS_secuencia;
public $IS_descri;
public $IS_fecha;
public $IS_fechaO;
public $IS_grupo;
public $id;
public function __construct($_IS_lector=NULL,
$_IS_sector=NULL,
$_IS_Hruta=NULL,
$_IS... |
Python | UTF-8 | 2,938 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/python
#
# Copyright 2020 Google LLC
#
# 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 by applicable law or ag... |
Shell | UTF-8 | 1,018 | 2.671875 | 3 | [] | no_license | # Maintainer: carstene1ns <arch carsten-teibes de> - http://git.io/ctPKG
# Contributor: Sam S. <smls75@gmail.com>
# Contributor: Daniel Scharrer <daniel@constexpr.org>
pkgname=innoextract
pkgver=1.6
pkgrel=1
pkgdesc="A tool to extract installers created by Inno Setup"
url='http://constexpr.org/innoextract/'
arch=('i68... |
Ruby | UTF-8 | 3,162 | 2.96875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
require "psbot/open_ended_queue"
module PSBot
# Manages all outgoing messages, applying rate throttling
# and fair distribution.
#
# @api private
class MessageQueue
def initialize(socket, bot)
@socket = socket
@queues = {:private => OpenEnde... |
C# | UTF-8 | 1,776 | 2.515625 | 3 | [] | no_license | using MySql.Data.Entity;
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Data.Entity;
using System.Linq;
using System.Web;
using InvestingMVC.Models;
namespace InvestingMVC
{
[DbConfigurationType(typeof(MySqlEFConfiguration))]
public class M... |
Java | UTF-8 | 30,285 | 2.375 | 2 | [
"BSD-2-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
* #%L
* Parsington: the SciJava mathematical expression parser.
* %%
* Copyright (C) 2015 - 2023 Board of Regents of the University of
* Wisconsin-Madison.
* %%
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
... |
C | UTF-8 | 2,153 | 3.1875 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define XMAX 320
#define YMAX 200
#undef min
#define min(a, b) ((a) < (b) ? (a) : (b))
#undef max
#define max(a, b) ((a) > (b) ? (a) : (b))
struct point {
int x;
int y;
};
struct rect {
struct point pt1;
struct point pt2;
};
struct point pt = { 100, 10... |
Go | UTF-8 | 4,663 | 2.96875 | 3 | [] | no_license | package runners
import (
"fmt"
"github.com/gokadin/ml-framework/telemetry"
"strconv"
"time"
)
type metricEvents struct {
trainingStarted chan bool
trainingFinished chan bool
epochStarted chan int
epochFinished chan float32
batchStarted chan int
batchFinished chan bool
batchLoss ... |
Java | UTF-8 | 6,378 | 1.898438 | 2 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*L
* Copyright Leidos
* Copyright Leidos Biomedical
*
* Distributed under the OSI-approved BSD 3-Clause License.
* See http://ncip.github.com/cananolab/LICENSE.txt for details.
*/
package gov.nih.nci.cananolab.system.applicationservice.impl;
import gov.nih.nci.cananolab.domain.particle.Sample;
import gov.n... |
Python | UTF-8 | 2,417 | 2.65625 | 3 | [] | no_license | import requests, json
from lxml import etree
from utils import get_headers_cookies
# pip install requests[socks] -U
proxies = {
'http': 'socks5://127.0.0.1:1080',
'https': 'socks5://127.0.0.1:1080'
}
proxies = None
def get_all_after_2016(years = ['2017', '2018', '2019'], write_to_json = False):
# only fo... |
Java | UTF-8 | 1,125 | 2.203125 | 2 | [] | no_license | package com.android.andi.mytrip.Fragments;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.android.andi.mytrip.R;
import com.android.andi.my... |
Markdown | UTF-8 | 1,326 | 2.796875 | 3 | [] | no_license | ---
title: tmp_Android_get_ip
abbrlink: 16faf7d3
tags:
---
Get IP address
===
```
/**
* Get IP address from first non-localhost interface
* @param useIPv4 true=return ipv4, false=return ipv6
* @return address or empty string
*/
public static String getIPAddress(boolean useIPv4) {
try {
List<NetworkIn... |
Python | UTF-8 | 899 | 2.78125 | 3 | [
"MIT"
] | permissive | from planner.frame.figure import Figure
from svgwrite import shapes
class Rect(Figure):
""" Rectangle representation """
def __init__(self, x=0, y=0, width=1, height=1, **attribs):
"""
x, y - coordinates of left top corner
"""
self.corner = (x, y)
self.size = (width, ... |
Java | UTF-8 | 303 | 2.171875 | 2 | [
"MIT"
] | permissive | package nl.eernie.jmoribus;
import nl.eernie.jmoribus.annotation.Given;
import nl.eernie.jmoribus.annotation.RequiredVariables;
public class RequiredVariableSteps
{
@RequiredVariables("requiredVariableA")
@Given("step a")
public void methodA()
{
// do something with requiredVariableA here
}
}
|
Python | UTF-8 | 7,039 | 3.0625 | 3 | [] | no_license | # Vladislav 25.02.21
# Fitting procedure
import numpy as np
from scipy.optimize import curve_fit
class FitFunctionClassAbstract:
def __init__(self, gamma, small_delta, big_delta):
self.fit_function = None
self.gamma = gamma
self.small_delta = small_delta
self.big_delta = big_delta... |
Markdown | UTF-8 | 1,676 | 3.890625 | 4 | [] | no_license | # Vue Basics
Quick notes on Vue.js
* [Basics](#basics)
* [Computed Properties](#computed-properties)
## Basics
### The simplest Vue app
```html
<div id="app">
{{ message}}
</div>
```
```js
var app = new Vue({
el: '#app',
data: {
message: 'Hello world!'
}
})
```
Output
```html
<div id="app">
Hello ... |
Markdown | UTF-8 | 1,767 | 3.546875 | 4 | [] | no_license | # day23 日常学习
## 概要
---
## 知识点
### 1. shader
float用于位置和纹理坐标,half用于其他所有内容。fixed通常可以等价于half。
### 2. WeakReference
```c
1.强引用
我们实例化一个对象,直接引用了这个对象就是强引用。在这个对象被强引用的时,GC无法回收这个对象。
只有当该对象所有的强引用都失去的时候,GC才会回收该对象。
2.弱引用
弱引用可以让您保持对对象的引用,同时允许GC在必要时释放对象,回收内存。
一般使用场景:对象过大,并且不经常访问。这样我们就可以创建一个弱引用,当不常用该对象的时... |
Java | UTF-8 | 13,145 | 1.820313 | 2 | [] | no_license | package com.github.wangfeng.mybatis_generator.entity;
import java.util.Date;
public class AdminSysMenuDO {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column admin_sys_menu.id
*
* @mbg.generated Sun Sep 08 16:48:42 CST 2019
*/
p... |
TypeScript | UTF-8 | 366 | 2.75 | 3 | [] | no_license | import { initialState } from "../store/InitialState"
import * as Actions from "./Action"
import { Action } from "./ActionType"
export const BooleanReducer = (state = initialState.boolean, action: Action) => {
switch (action.type) {
case Actions.SKELETON:
return {
...state,
...action.payload... |
PHP | UTF-8 | 3,040 | 3.171875 | 3 | [
"MIT"
] | permissive | <?php namespace Arcanedev\Stripe\Utilities;
use Arcanedev\Stripe\Contracts\Utilities\UtilSet as UtilSetContract;
use ArrayIterator;
use Countable;
use IteratorAggregate;
/**
* Class UtilSet
*
* @package Arcanedev\Stripe\Utilities
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
*/
class UtilSet implements ... |
Java | UTF-8 | 833 | 4.1875 | 4 | [] | no_license | package miniExceptionLizard;
public class Lizard {
public String name;
public Lizard(String name) throws IllegalArgumentException {
if (name == null) {
throw new IllegalArgumentException();
}
this.name = name;
}
public static void main(String[] args) {
Lizar... |
Java | UTF-8 | 1,234 | 3.265625 | 3 | [] | no_license | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.Socket;
/**
* Created by Kenneth Mintah on 11/11/15.
* This class receives current date and time from the middle server
*/
public class DateClient {
public static void main(S... |
C++ | UTF-8 | 2,203 | 2.515625 | 3 | [
"MIT"
] | permissive | #pragma once
#include "BaseContentsInterface.h"
class Radiation : public BaseContentsInterface
{
float radius;
int startAngle;
int stopAngle;
int mSpeed;
vector<vector<float> > mWaves;
public:
Radiation()
{
radius = 400;
startAngle = 0;
stopAngle = 0;
... |
PHP | UTF-8 | 170 | 3.109375 | 3 | [] | no_license | <?php
// display function
function display($nameValues) {
foreach ($nameValues as $name => $value) {
echo($name . ": " . $value . "<br />");
}
}
?>
|
Markdown | UTF-8 | 704 | 2.65625 | 3 | [] | no_license | # Pint Of Sale System
Requirements
1) Invetory entry via code-reader
2) Generate receipts, and variuos financial reports
System cost
1) 23 000-patrial,no M-PESA,no online backup,no SMS sending
2) 60 000 full system including online backup and M-PESA module
Cost per module
... |
Java | UTF-8 | 832 | 3.375 | 3 | [] | no_license | public class OffByOne implements CharacterComparator {
@Override
public boolean equalChars(char x, char y) {
int intX = x;
// System.out.println(intX);
int intY = y;
// System.out.println(intY);
if ( intX - intY == 1 || intX - intY == -1) {
return true;
... |
Python | UTF-8 | 812 | 2.609375 | 3 | [] | no_license | #!/usr/bin/env python3
# USAGE: call this file on file or directory to return predicted results
import pickle
from NBfunc import *
from spamkeys import sorted_spam_keys
import os
import sys
def TestModel(filepath,filename):
test_matrix = CreateSingleFeatureMatrix(filepath,sorted_spam_keys)
result = int(loaded_mod... |
Python | UTF-8 | 3,466 | 2.828125 | 3 | [] | no_license | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from time import sleep
import settings
import platform
import pywhatkit as kit
'''
For each time that we init our programawe should know what OS we're using,
so, It just gonn... |
Rust | UTF-8 | 1,613 | 3.125 | 3 | [] | no_license | use super::*;
#[skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct EntryQuote<'a> {
#[serde(flatten)]
pub base: EntryBaseData<'a>,
pub entries: Entries<'a>,
pub by: Option<&'a str>,
pub from: Option<&'a str>,
/// If th... |
C++ | UTF-8 | 5,070 | 3.34375 | 3 | [] | no_license | #include <StackArray.h>
/**
* L: left
* R: right
* S: straight
* B: return
*/
StackArray <char> movements;
const char LEFT = 'L';
const char STRAIGHT = 'S';
const char RIGHT = 'R';
const char RETURN = 'B';
int avanza1 = 6;
int avanza2 = 3;
int infra1 = 8;
int infra2 = 9;
int valorInfra = 1;
void setup() {
pi... |
C | UTF-8 | 1,569 | 3.515625 | 4 | [] | no_license | typedef struct No {
unsigned int digito;
struct No *prox;
} No;
/* Esse TAD é uma lista ligada que representa um número grande
de maneira inversa. Ou seja, se quisermos armazenar 1234567,
ele será representado como 7->6->5->4->3->2->1. */
typedef No* NumeroGrande;
/* Inicializa um NumeroGrande. */
NumeroGra... |
C++ | UTF-8 | 819 | 3.734375 | 4 | [] | no_license | //WAP to input PRICE and calculate and print DISCOUNT and NET PRICE by using DISCOUNT as Friend class and NET as friend function
#include<iostream>
using namespace std;
class DISCOUNT;
class PRICE
{
float P;
public:
void input()
{
cout<<"\nEnter Price:";
cin>>P;
}
void show()
{... |
Python | UTF-8 | 1,742 | 3.171875 | 3 | [] | no_license | def get_probs(Q_s, epsilon, nA): #nA is no. of actions in the action space
# obtains the action probabilities corresponding to epsilon-greedy policy
policy_s = np.ones(nA) * epsilon / nA
best_a = np.argmax(Q_s)
policy_s[best_a] = 1 - epsilon + (epsilon / nA)
return policy_s
'''
Now we will use t... |
Markdown | UTF-8 | 472 | 2.6875 | 3 | [] | no_license | Train Scheduler
### Overview
A train schedule application that incorporates Firebase to host arrival and departure data. Information is retrieved and manipulated with Moment.js. This website will provide up-to-date information about various trains, namely their arrival times and how many minutes remain until they arr... |
PHP | UTF-8 | 1,518 | 2.578125 | 3 | [] | no_license | <?php
class HeruValidator extends Illuminate\Validation\Validator {
/**
* validasi nama sekarang
*
* @param array $attribute
* @param array $value
* @param array $parameters
* @return bool
*/
public function validateNamaSekarang($attribute, $value, $parameters)
{
return strtolower($value) == strtol... |
Java | ISO-8859-1 | 1,074 | 3.71875 | 4 | [] | no_license | import java.util.Scanner;
public class Ejercicio4 {
public static void main(String args []){
char c;
int num;
Scanner teclado = new Scanner (System.in);
num = teclado.next().charAt(0);
c = (char) num;
System.out.println("Introduce un caracter :");
//c = (char)... |
JavaScript | UTF-8 | 3,910 | 2.828125 | 3 | [] | no_license | let express = require('express');
let app = express();
let http = require('http');
let server = http.Server(app);
let socketIO = require('socket.io');
let io = socketIO(server);
io.origins('*:*')
const port = process.env.PORT || 80;
server.listen(port, () => {
console.log(`started on port: ${port}`);
});
const... |
Java | UTF-8 | 14,787 | 2.234375 | 2 | [] | no_license | package media.interaktif;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
public class Stukas extends javax.swing.JFrame {
private DefaultTableModel tabmode;
private ResultSet hasil;
CRUDstukas stukas = new CRUDstuka... |
C# | UTF-8 | 813 | 2.515625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BiblioCat.Data
{
public class Series
{
[Key]
public int SeriesId { get; set; }
[Requi... |
Markdown | UTF-8 | 5,494 | 3.03125 | 3 | [] | no_license |
What is Thunder?
Thunder is an open-source and easy to use Java Networking Framework
for Java 1.8 and higher
Thunder uses TCP for guranteed data transfer
Thunder is thread safe and supports Compression of Packets.
---------
Content:
- [Understanding the Basics](#basics)
- [ThunderServer](#thunderserver)
- [Th... |
Python | UTF-8 | 2,474 | 2.828125 | 3 | [] | no_license | '''
Description:
This script is used to install an angleReader node based on selection.
The first selected item will be used as base and the second as driver.
Arguments:
rotateAxis(optional = [1,0,0]) - The axis that will be read by the angleReader.
frontAxis(optional = [0,1,0]) - The front axis that w... |
Java | UTF-8 | 2,562 | 2.34375 | 2 | [] | no_license | package test.restservices;
import java.io.IOException;
import test.restservices.ResultMessage;
import java.io.InputStream;
import java.nio.charset.Charset;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.htt... |
C++ | UTF-8 | 687 | 2.6875 | 3 | [
"MIT"
] | permissive | #include "file/file.h"
#include "util.h"
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
File::File(const std::string &path, bool readonly) {
SYSCALL(fd_ = open(path.c_str(), readonly ? O_RDONLY : O_RDWR | O_CREAT,
S_IRWXU));
SYSCALL(le... |
PHP | UTF-8 | 981 | 2.84375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Api;
use GuzzleHttp\Client;
class AlphaVantage
{
private static $key;
function __construct()
{
self::$key = env('ALPHAVANTAGE_KEY');
}
public function daily($symbol, $dataType = 'csv', $outputSize = 'compact')
{
try {
$client = new Client()... |
C++ | UTF-8 | 4,497 | 2.640625 | 3 | [] | no_license | /*
Fireplace Starter (ESP8266)
ESP8266 module that sends a remote control signal to start a fireplace
Created 31 August 2018
By Ivan Sy
Modified 6 September 2018
By Ivan Sy
https://github.com/isyca/esp8266-fireplace-starter
*/
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer... |
Java | UTF-8 | 1,565 | 2.21875 | 2 | [] | no_license | package com.mmj.user.manager.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
* @description: 会员优惠券
* @auther: KK
* @date: 2019/7/11
*/
@Data
@ApiModel(value = "会员优惠券", descripti... |
Markdown | UTF-8 | 3,896 | 3.1875 | 3 | [
"Apache-2.0"
] | permissive | # InterviewTricks
# Decided to store various types of exercises that fall under the following categories:
1. Trick questions that my friends tell me about.
2. Common algorithms, linkedlist,queue, tree, trie/suffix trees, sorts, searches
3. Numerical algorithms that commonly pop up as Trick interview questions
4. JDK8 L... |
JavaScript | UTF-8 | 2,510 | 2.640625 | 3 | [] | no_license | const mysql = require('../database/mysql-libs')
let mongo = require('./../database/mongo-libs');
/**
* @function <b> signup </b> <br>
* Service function for registering a new user
* @param name email password lat long dob phoneNumber
* @return {Object} result object from sql
*/
const signup = async ... |
Python | UTF-8 | 1,073 | 3.71875 | 4 | [] | no_license | # Abir Taheer
# IntroCS pd1
# HW26 -- 000 000 111, v10
# 2019-03-18
def bondify(name: str) -> str:
"""
:param name: The name of the person
:return: The name, bondified
>>> bondify("Abir Taheer")
'Taheer, Abir Taheer'
>>> bondify("banana man")
'man, banana man'
>>> bondify("coolio")
... |
Markdown | UTF-8 | 1,207 | 3.109375 | 3 | [] | no_license | # FCP-Codes
This is my final course project codes. It's a project that I have done in my undergraduate Electrical Engineering degree, where I classify face expressions using machine learning.
-frames:
This notebook processes videos in a given directory. First it extract the frames of the video (29.97 frames per second... |
Java | UTF-8 | 401 | 2.90625 | 3 | [] | no_license | package org.okarmus.game.utils.comparator;
import java.util.Comparator;
import org.okarmus.game.model.card.Card;
public class CardComparator implements Comparator<Card>{
@Override
public int compare(Card c1, Card c2) {
int colorCompare = c1.getColor().getPriority() - c2.getColor().getPriority();
if (colorComp... |
C++ | UHC | 9,397 | 3 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <ctime>
using namespace std;
#include "Header.h"
#include "Func.h"
int Player::plnum = 1; // static ܺ ʱȭ
int Player::turn = 1; // static ܺ ʱȭ
extern int shopbalance = 1; // Ͽ ָ ֵ ϴ
int main()
{
int n, num, c;
string name;
srand((unsigned... |
JavaScript | UTF-8 | 1,926 | 3.203125 | 3 | [] | no_license | console.log("================================");
console.log("Welcome to Your Sandbox Console.");
console.log("================================");
console.log("Click on http://jquery.com to head to the docs");
// Q: How do you make a DOM element a jQuery object?
// A: Target it with a css selector and then just wrap ... |
Java | UTF-8 | 376 | 2.5625 | 3 | [
"MIT"
] | permissive | package PackageUsers;
import java.io.Serializable;
/**
* Interface do User
*/
public interface IUser extends Comparable<IUser>, Serializable{
public String getUserID();
public String getName();
public IUser clone();
/**
* Calcula o hash value do User
* @return hash value do... |
Python | UTF-8 | 4,717 | 3.109375 | 3 | [
"MIT"
] | permissive | # !/usr/bin/env python
# coding: utf-8
"""
Converts a tree structure in to a valid JSON.
This module works with both Python 2 and 3.
"""
__version__ = '0.1'
version = __version__
import logging
import nltk
import json
from nltk.chunk.regexp import *
LOG = logging.getLogger("treetojson")
def set_debug(debug=True... |
C++ | UTF-8 | 455 | 3.25 | 3 | [] | no_license | #include <cstdlib>
#include <iostream>
#include <cmath>
using namespace std;
int main(int argc, char** argv) {
double R, a, perumetr, square;
cout<<"Введіть радіус описаного кола навколо 17-кутника: ";
cin>>R;
a=2*R*sin(3.14/17);
perumetr=17*a;
cout<<"Периметр = "<<perumetr<<endl;
square=(1... |
JavaScript | UTF-8 | 265 | 3.703125 | 4 | [] | no_license | let nthNumber = 10;
const sum_of_multiples = function(nthNumber){
let sum = 0;
for(let index=1; index < nthNumber; index++){
if(index % 3 == 0 || index % 5 == 0){
sum = sum + index;
}
}
return sum;
}
console.log(sum_of_multiples(nthNumber));
|
Python | UTF-8 | 1,275 | 3.65625 | 4 | [] | no_license | class BinaryNode:
def __init__(self, e: chr):
self.element = e
self.left = None
self.right = None
def read_preorder(r: BinaryNode):
global index
if index < l - 1:
if s[index + 1] == '#':
if index < l - 2:
if s[index + 2] == '#':
... |
JavaScript | UTF-8 | 506 | 3.8125 | 4 | [] | no_license | function talk (sound) {
console.log(this)
console.log(this.sound)
}
let animal ={
talk
}
let cat = {
sound: 'Meow'
}
let dog ={
sound: 'Woofering'
}
let prarieDog = {
howl: function(){
console.log(this.sound.toUpperCase())
}
}
// cat.talk()
Object.setPrototypeOf(cat, animal)
Object.setPrototypeOf(dog, ... |
JavaScript | UTF-8 | 733 | 2.5625 | 3 | [] | no_license | const { assert } = require('chai');
const { urlsForUser } = require('../helpers.js');
const urlDatabase = {
"lksr5j": { longURL: 'http://www.facebook.com', userID: 'userRandomID' }
};
describe('urlsForUser', function() {
it('should return user specific URLs', function() {
const userURLs = urlsForUser('userRan... |
PHP | UTF-8 | 729 | 2.578125 | 3 | [] | no_license | <?php
//process client request (via URL)
include ("function.php");
header("Content-Type:application/json");
if (!empty($_GET['name'])) {
$name=$_GET['name'];
$price=get_price($name);
if(empty($price)){
//book not found
deliver_response(200,"book not found", NULL);
}
else{
//respond book price
deliver_r... |
Java | UTF-8 | 665 | 3 | 3 | [] | no_license | package lists.model;
import java.util.ArrayList;
import javax.swing.JOptionPane;
public class ArrayListController
{
private ArrayList<String> firstWords;
public ArrayListController() //default constructor
{
firstWords = new ArrayList<String>();
}
public void start()
{
firstWords.add("asdfjkl;sadjkfjl")... |
JavaScript | UTF-8 | 1,368 | 3.3125 | 3 | [] | no_license | function mostrar()
{
var letra,num,par=0,impar=0,respuesta,cero=0,pos=0,neg=0,prom=0;
while(respuesta!="no"){
letra=prompt("Ingrese una letra");
console.log(letra);
num=parseInt(prompt("Ingrese un numero entre -100 y 100: "))
while(isNaN(num) || num<-100 || n... |
C | UTF-8 | 17,833 | 3.28125 | 3 | [] | no_license | /**
* \file fonctionGrille.c
* \brief Contient toutes les fonctions utiles à gestion la grille de jeu
* \author Asmae Bouhandi
* \version 1
* \date 01 avril 2020
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <math.h>
#include <ctype.h>
#include "../lib/commun.h"
#inclu... |
Java | UTF-8 | 31,448 | 1.835938 | 2 | [] | no_license | package com.android.settings.wifi.cmcc;
import android.app.AlarmManager;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.app.PendingIntent;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.co... |
Python | UTF-8 | 465 | 3.34375 | 3 | [] | no_license | from turtle import *
speed(0)
bgcolor("Black")
color("White")
pensize(5)
def hex(side):
for count in range(2):
forward(side)
left(120)
def rotation():
n = 0
colormode(255)
c = 0
pencolor(c,c,c)
for count in range(500):
if c != 255:
c += 255.0/120
... |
Markdown | UTF-8 | 1,105 | 2.6875 | 3 | [] | no_license | #不要使用retainCount
###主要内容
1. NSObject协议中定义了下面的方法,用于查询对象当前的保留计数:
- (NSUInteger)retainCount ;
2. ARC中这个方法这个方法已经被废弃,如果在ARC中调用,编译器就会报错,这和在ARC中调用`retain`,`release`,`autorelease`方法时情况一样
3. 它返回的保留计数只是某个给定时间点上的值,该方法并未考虑到系统会杀害后吧自动释放池清空,因而不会讲后续的释放操作作为返回值里减去,这样的话,此值就未必能真实反映实际的引用计数,因此不要用retainCount作为循环判断的条件
4. retainCount... |
Java | UTF-8 | 1,678 | 3.796875 | 4 | [] | no_license | Given a binary tree
struct TreeLinkNode {
TreeLinkNode *left;
TreeLinkNode *right;
TreeLinkNode *next;
}
Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL.
Initially, all next pointers are set to NULL.
Note:
You may only use cons... |
JavaScript | UTF-8 | 3,855 | 2.546875 | 3 | [] | no_license | // Slider options
var mySwiper = new Swiper(".swiper-container", {
// Optional parameters
direction: "vertical",
loop: true,
// If we need pagination
pagination: {
el: ".swiper-pagination",
},
// Navigation arrows
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
... |
Java | UTF-8 | 3,374 | 2.703125 | 3 | [] | no_license | package com.itextpdf.highlevel.notused.appendix;
import com.itextpdf.io.font.constants.StandardFonts;
import com.itextpdf.kernel.colors.ColorConstants;
import com.itextpdf.kernel.font.PdfFont;
import com.itextpdf.kernel.font.PdfFontFactory;
import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.kernel.pdf.Pdf... |
Java | UTF-8 | 1,481 | 2.171875 | 2 | [] | no_license | package bg.infosys.interns.bmanagement.ws.test;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.when;
import java.util.Arrays;
import java.util.List;
import javax.transaction.Transactional;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.moc... |
Markdown | UTF-8 | 715 | 3.109375 | 3 | [] | no_license | # GhostTweeter
**Periodically tweets out a random link to one of your Ghost blog post.**
Tweets are sent in the following format:
```
<post title>: <url> #<tag1> #<tag2>
```
Converts every tag into a hashtag (as long as characters are not >140)
*You must edit this code and enter in your own account authentication (s... |
C++ | UTF-8 | 2,383 | 2.703125 | 3 | [] | no_license | #include "light.h"
#include "program.h"
#include "camera.h"
bool Light::Create(const Name& name)
{
m_name = name;
#ifdef _DEBUG
m_debug_model = m_engine->Factory()->Create<Model>(Model::GetClassName());
m_debug_model->m_name = "model";
m_debug_model->m_engine = m_engine;
m_debug_model->m_scene = m_scene;
m_debu... |
C++ | UTF-8 | 4,039 | 3.203125 | 3 | [] | no_license |
#include <cfloat>
#include <iostream>
#include <thread>
#include <vector>
#include <chrono>
#include <mutex>
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
typedef size_t ID;
class IAccount
{
private:
std::mutex m_lock;
public:
virtual void Deposit( float amount ) = 0;
virtual void Withd... |
Python | UTF-8 | 14,697 | 2.96875 | 3 | [
"MIT"
] | permissive | """Library for interfaces into DataJoint pipelines."""
import datajoint as dj
import datetime
import numpy as np
DAY = 24 * 60 * 60
DEFAULT_FETCH_LIMIT = 1000 # Stop gap measure to deal with super large tables
class DJConnector():
"""
Primary connector that communicates with a DataJoint database server.
... |
Markdown | UTF-8 | 3,091 | 3.21875 | 3 | [] | no_license | # Frontend Mentor - Stats preview card component solution
This is a solution to the [Stats preview card component challenge on Frontend Mentor](https://www.frontendmentor.io/challenges/stats-preview-card-component-8JqbgoU62). Frontend Mentor challenges help you improve your coding skills by building realistic projects... |
Java | UTF-8 | 2,202 | 1.90625 | 2 | [] | no_license | package github.com.junhyoung.killingtime;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.media.Image;
import android.preference.DialogPreference;
import android.support.v7.app.AppCompatAc... |
Markdown | UTF-8 | 2,908 | 3.125 | 3 | [
"MIT"
] | permissive | # <dev-log />
A server with which I keep a development log. Anything from what's tripped me up, blocked me, or simply something I've learned.
The UI side of it is... let's go with functional.
## An API and a web server.
It's built with [Hapi] and attempted to be done in a RESTful way. The same urls can be cal... |
C# | UTF-8 | 1,478 | 3.125 | 3 | [] | no_license | using System;
using System.Diagnostics;
using System.Text;
using System.Threading.Tasks;
namespace CSharpTestingConsole
{
class Program
{
static void Main(string[] args)
{
bool useHiddenWindow = true;
Console.WriteLine("Hit a key when you're ready!");
Conso... |
Java | UTF-8 | 938 | 3.109375 | 3 | [] | no_license | package model;
import java.util.ArrayList;
import java.util.List;
import interfaces.Observer;
import interfaces.Subject;
public class EmailTopic implements Subject {
public List<Observer> observers;
private String message;
public EmailTopic() {
this.observers = new ArrayList<>();
}
@Override
pu... |
Java | UTF-8 | 7,907 | 2.53125 | 3 | [] | no_license | package edu.elon.cs.gamealarm.MiniGame2;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Point;
import android.media.MediaPlayer;
import android.util.AttributeSet;
import android.view.Dis... |
TypeScript | UTF-8 | 105 | 2.546875 | 3 | [] | no_license |
export interface IAuthentication<L, O> {
loginWithGoogle(): Promise<L>;
signOut(): Promise<O>;
}
|
Python | UTF-8 | 4,242 | 3.09375 | 3 | [
"MIT"
] | permissive | ### assignment 4-1 ###
import numpy as np
import pandas as pd
import scipy.io
import scipy
## 1.1 visual ##
all_data = scipy.io.loadmat("d:/data/ex04/ex4data1.mat")
X = all_data['X'] # shape (5000, 400)
y = all_data['y'] # shape (5000, 1)
w_set = scipy.io.loadmat("d:/data/ex04/ex4weights.mat")
W1 = w_set['Theta1'].T... |
Python | UTF-8 | 3,431 | 2.921875 | 3 | [
"MIT"
] | permissive | import asyncio
from collections import namedtuple
from vk import VK
import json
PoolRequest = namedtuple('PoolRequest', ['method', 'params', 'result'])
class RequestResult(object):
""" Результат запроса из пула """
__slots__ = ('_result', 'ready', '_error')
def __init__(self):
self._result = Non... |
Markdown | UTF-8 | 13,875 | 2.84375 | 3 | [] | no_license | ---
layout: post
title: Quagga and GNS3
---
* TOC
{:toc}
# Introduction
I've been meaning to play with [Quagga](http://www.quagga.net/) for sometime. One of the administrators of the
Quagga Project is an old friend of mine - I've had many debates with him over IRC, Facebook and Twitter over the years. Yet
des... |
C++ | UTF-8 | 976 | 3.125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int numUniqueEmails(vector<string>& emails) {
unordered_set<string> us;
for (string email : emails) {
string normalized;
bool local = true;
for (int i = 0, length = email.length(); i < length... |
Java | UTF-8 | 379 | 1.585938 | 2 | [
"Apache-2.0"
] | permissive | package com.atguigu.gmall.ums.dao;
import com.atguigu.gmall.ums.entity.MemberLoginLogEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* 会员登录记录
*
* @author canjian
* @email
* @date 2021-12-25 14:10:10
*/
@Mapper
public interface MemberLoginLogDao ... |
C# | UTF-8 | 1,313 | 3.234375 | 3 | [] | no_license | /*
* Link: https://leetcode.com/problems/number-of-connected-components-in-an-undirected-graph/submissions/
* Author: Dung Nguyen Tien (Chris)
*/
public class Solution {
public int CountComponents(int n, int[][] edges) {
if (edges.Length == 0 || edges[0].Length == 0) return n;
var map = ... |
Java | UTF-8 | 264 | 1.882813 | 2 | [] | no_license | package samplePackage1;
import samplePackage2.sP2_class2;
public class sP1_class1 extends sP2_class2{
public static void main(String[] args) {
// TODO Auto-generated method stub
sP2_class2 ob = new sP2_class2();
ob.display();
}
}
|
Markdown | UTF-8 | 1,744 | 2.921875 | 3 | [
"MIT"
] | permissive | # 《全栈之巅》学习笔记-登陆接口
## 1. 在login.vue中增加接口请求
```
methods:{
async login(){
const res=await this.$http.post('login',this.model)
localStorage.token=res.data.token
this.$router.push('/')
this.$message({
type:'success',
message:'登陆成功'
})
}
```
## 2. 去index.js中增加接口
```
ap... |
JavaScript | UTF-8 | 1,134 | 2.59375 | 3 | [
"MIT",
"BSD-3-Clause"
] | permissive | require(['jquery', 'ejs'], function ($, EJS) {
var photographerId = $('#photographer').data('photographer').id;
var trStr = '<tr><td><%= items.join("</td><td>") %></td></tr>';
var template = new EJS({ text: trStr });
$('.coupon .form-inline').on('click', '.btn-exchange', function () {
var $exchangeBtn = $(... |
Java | UTF-8 | 727 | 2.5 | 2 | [] | no_license | package de.fiduciagad.ase.postagecharge;
import static de.fiduciagad.ase.postagecharge.DefinitionBuilder.definitionOfType;
import static de.fiduciagad.ase.postagecharge.Range.RangeBuilder.from;
import static de.fiduciagad.ase.postagecharge.Type.LETTER;
public final class Definitions {
private Definitions() ... |
Ruby | UTF-8 | 88 | 3.140625 | 3 | [] | no_license | class Piece
def initialize(x, y, color)
@x = x
@y = y
@color = color
end
end
|
C# | UTF-8 | 957 | 2.59375 | 3 | [] | no_license | using Questionnaires.QL.AST.Types;
using System.Diagnostics;
using System.Windows.Controls;
namespace Questionnaires.UI.Widgets
{
public class CheckBoxWidget : QuestionWidget
{
private CheckBox CheckBox;
public CheckBoxWidget() : base(new CheckBox())
{
Debug.Assert(Control... |
Java | UTF-8 | 1,086 | 1.960938 | 2 | [] | no_license | package com.lizc.app.network.http.datasource;
import com.lizc.app.network.http.config.LizcHttpConfig;
import com.lizc.app.network.http.datasource.base.INewContentDataSource;
import com.lizc.app.network.http.request.GetHomeRecommendsRequest;
import com.lizc.app.network.http.service.ApiService;
import com.lizc.app.netw... |
Shell | UTF-8 | 1,144 | 2.6875 | 3 | [] | no_license | GREEN='\033[1;32m'
NC='\033[0m'
WORKER1_IP="172.16.0.2"
WORKER2_IP="172.16.0.3"
MASTER_IP="172.16.0.1"
MASTER_MGMT_IP="172.30.0.51"
WORKER1_MGMT_IP="172.30.0.52"
WORKER2_MGMT_IP="172.30.0.53"
CLEAR_IPTABLES="sudo iptables -t nat -F && sudo iptables -F && sudo iptables -X"
eval $CLEAR_IPTABLES
ssh -i ~/.ssh/worker1 o... |
Java | UTF-8 | 8,513 | 1.773438 | 2 | [] | no_license | package uk.ee.framework.elements.sections.shop;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import ru.yandex.qatools.htmlelements.element.Select;
import ru.yandex.qatools.htmlelements.elemen... |
Markdown | UTF-8 | 866 | 2.6875 | 3 | [] | no_license | # JAVA ALGORITHM 6
### 문제
수빈이는 동생과 숨바꼭질을 하고 있다. 수빈이는 현재 점 N(0 ≤ N ≤ 100,000)에 있고, 동생은 점 K(0 ≤ K ≤ 100,000)에 있다. 수빈이는 걷거나 순간이동을 할 수 있다. 만약, 수빈이의 위치가 X일 때 걷는다면 1초 후에 X-1 또는 X+1로 이동하게 된다. 순간이동을 하는 경우에는 1초 후에 2*X의 위치로 이동하게 된다.
수빈이와 동생의 위치가 주어졌을 때, 수빈이가 동생을 찾을 수 있는 가장 빠른 시간이 몇 초 후인지 구하는 프로그램을 작성하시오.
### 입력
첫 번째 줄에 수빈이가 있는 ... |
Java | UTF-8 | 1,966 | 2.765625 | 3 | [] | no_license | package nl.jellow.wimalert.util;
import android.util.Log;
import android.util.Pair;
import java.security.MessageDigest;
import java.util.Arrays;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import nl.jellow.wimalert.App;
/**
* Created by Jelle on 12... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.