language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
Markdown | UTF-8 | 9,051 | 2.90625 | 3 | [] | no_license | > ##guide-demo
- [x] sys-on-emit(系统事件)
> ###事件机制说明:<br >
> 一句话,事件机制可以解决这种需求:`某个条件达成才做某事` <br >
> node.on('eventName',callback,target);<br >
> 参数一:eventName 事件名 用于区别监听的事件类型<br >
> 参数二: callback 回调函数 当事件名所描述的条件发生时,触发该函数<br >
> 参数三:target 调用者, 指定调用该回调函数的调用者,通常是回调函数所处的这个对象(this),也可以动态指定别的对象来调用回调函数。<br >
> ###鼠标事件
> ##... |
C++ | UTF-8 | 534 | 2.890625 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
class studentStats
{
public:
string getFName() const;
string getLName() const;
int getTScore() const;
int getPScore() const;
double getGPA() const;
char getGrade() const;
void setFName(string first = "");
void setLName(string last = "");
void... |
Shell | UTF-8 | 1,336 | 3.609375 | 4 | [] | no_license | #!/bin/bash
#
# Dump OpenVPN Client configs
#
if [[ "${DEBUG}" == "true" ]]; then
set -x
fi
display_info() {
echo -e "\033[1;32mInfo: $1\033[0m"
}
display_error() {
echo -e "\033[1;31mError: $1\033[0m"
}
export OVPN_ENV_FILE="${OVPN_DIR}/ovpn_env.sh"
if [[ ! -f "${OVPN_ENV_FILE}" ]]; then
display_... |
Markdown | UTF-8 | 474 | 2.78125 | 3 | [] | no_license | # Pong_Remastered
Author: Koustabh Das
mail: keddy8218@gmail.com
Originally programmed by Atari in 1972. Features two paddles, controlled by players, with the goal of getting the ball past your opponent's edge.First to 10 points wins. This version is built to more closely resemble the NES than the original Pong m... |
Java | UTF-8 | 993 | 2.375 | 2 | [] | no_license | package com.progerslifes.diplom.facades.converters.user;
import com.progerslifes.diplom.entity.UserProfile;
import com.progerslifes.diplom.facades.converters.GenericConverter;
import com.progerslifes.diplom.facades.dto.UserProfileDTO;
import org.springframework.stereotype.Component;
@Component
public class UserProfil... |
Java | UTF-8 | 1,249 | 1.921875 | 2 | [] | no_license | package com.ecust.touhouairline.repository;
import com.ecust.touhouairline.entity.OrderDetailEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
@Repository
public interface OrderDetailRepository... |
PHP | UTF-8 | 1,096 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
namespace Helix\Shopify;
use Helix\Shopify\Base\AbstractEntity;
use Helix\Shopify\Base\AbstractEntity\CrudTrait;
/**
* A carrier service.
*
* @see https://shopify.dev/docs/admin-api/rest/reference/shipping-and-fulfillment/carrierservice
*
* @method bool isActive ()
* @method string g... |
Go | UTF-8 | 545 | 2.890625 | 3 | [
"Apache-2.0"
] | permissive | package check
import (
"reflect"
)
func IsValueNilOrEmpty(c interface{}) bool {
if c == nil {
return true
}
value := reflect.ValueOf(c)
switch value.Kind() {
case reflect.Ptr:
return value.IsNil()
case reflect.Slice, reflect.Array, reflect.String:
return value.Len() == 0
}
return false
}
func IsValueN... |
C# | UTF-8 | 1,006 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | using Microsoft.SPOT.Hardware;
using System;
using GTM = Gadgeteer.Modules;
namespace Gadgeteer.Modules.GHIElectronics
{
/// <summary>
/// A OneWire X1 module for Microsoft .NET Gadgeteer
/// </summary>
[Obsolete]
public class OneWireX1 : GTM.Module
{
private OneWire oneWire;
private OutputPort port;
///... |
C# | UTF-8 | 2,727 | 3.34375 | 3 | [] | no_license | using System;
using System.Linq;
namespace _1QuickStartEntityFramework
{
class Program
{
static void Main(string[] args)
{
//Ctrate a DB Connections with using block
using (var dbContext = new NorthwindSlimEntities())
{
//Lecture-1 or Day-1
... |
C++ | UTF-8 | 1,790 | 3.46875 | 3 | [] | no_license | /*
* Progetto di Physics Programming
* Fabio Cogliati, Manuele Nerucci
*/
#pragma once
#include "Collider.h"
namespace PhysicEngine
{
//Forward declarations
struct Collision;
/*Classe che rappresenta un plane collider con funzione Ax + By + Cz = 0*/
class PlaneCollider : public Collider
{
public:
/*Enum ... |
Markdown | UTF-8 | 11,928 | 3.4375 | 3 | [
"CC0-1.0"
] | permissive | ---
layout: post
title: "Topology, Part I: Topological Spaces"
author: "Jay Havaldar"
date: 2017-08-04
mathjax: true
category: [math]
download: true
category: notes
---
## Definition of a Topology
**Definition:** Let $X$ be a set. We define a **topology** $\mathcal{T}$ on $X$ to be a collection of sets (called **op... |
Java | UTF-8 | 4,241 | 1.84375 | 2 | [
"Apache-2.0"
] | permissive | package com.feng.project.sales.quote.controller;
import com.feng.common.utils.DateUtils;
import com.feng.common.utils.security.ShiroUtils;
import com.feng.framework.aspectj.lang.annotation.Log;
import com.feng.framework.web.controller.BaseController;
import com.feng.framework.web.domain.JSON;
import com.feng.framewor... |
C++ | UTF-8 | 2,042 | 2.625 | 3 | [] | no_license | // hw511_CInstrument.cpp
#ifndef HW511_CINSTRUMENT_H_
#include "hw511_CInstrument.h"
#endif
// additional constructor
CInstrument::CInstrument(uint32_t beginTm, uint32_t endTm, int noteOffset,
int chan, int patch, int vol, int pan, int startNote,
int measNum)
: CMidiTrack(beginTm, endTm, no... |
C | UTF-8 | 2,374 | 3.703125 | 4 | [
"MIT"
] | permissive | #include <stdlib.h>
#include <stdio.h>
#include "list.h"
node* newNode(int value) {
node* elem = (node*) malloc(sizeof(node));
elem->next = NULL;
elem->data = value;
return elem;
}
node* initialize(node* list, int n) {
while(n) {
node* elem = newNode(n);
elem->next = list;
list = elem;
--n;... |
Java | UTF-8 | 1,417 | 2.53125 | 3 | [] | no_license | package com.example.movieapplication.session;
import android.text.TextUtils;
import com.google.gson.Gson;
import java.util.Map;
public class SharedPreferences {
protected android.content.SharedPreferences sharedPreferences;
public SharedPreferences(android.content.SharedPreferences sharedPreferences) {
... |
TypeScript | UTF-8 | 1,204 | 2.96875 | 3 | [
"MIT"
] | permissive | import { DviCommand, merge } from '../parser';
import { Machine } from '../machine';
class Papersize extends DviCommand {
width: number;
height: number;
constructor(width : number, height : number) {
super({});
this.width = width;
this.height = height;
}
execute(machine : Machine) {
machi... |
Markdown | UTF-8 | 3,933 | 2.78125 | 3 | [
"MIT",
"LicenseRef-scancode-other-permissive",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | dOmega Library
=====================================
This code implements an efficient algorithm for the maximum clique
problem that runs in time polynomial in the graph's size, but exponential
in the clique-core gap g:=(d+1)-omega (where d denotes the graph's degeneracy and omega
the size of the largest clique).
Whe... |
Swift | UTF-8 | 1,512 | 3.546875 | 4 | [] | no_license | //
// QuizModel.swift
// Quiz Fun
//
// Created by Gina Sprint on 9/20/18.
// Copyright © 2018 Gina Sprint. All rights reserved.
//
import Foundation
struct QuizModel {
// use parallel arrays for our questions and their answers
private let questions: [String]
private let answers: [String]
private ... |
SQL | UTF-8 | 522 | 2.90625 | 3 | [] | no_license | -- golang_dbという名前のデータベースを作成
CREATE DATABASE golang_db;
-- golang_dbをアクティブ
use golang_db;
-- usersテーブルを作成。名前とパスワード
CREATE TABLE users (
id INT(11) AUTO_INCREMENT NOT NULL,
name VARCHAR(64) NOT NULL,
password CHAR(30) NOT NULL,
PRIMARY KEY (id)
);
-- usersテーブルに2つレコードを追加
INSERT INTO users (name, password) ... |
Python | UTF-8 | 7,628 | 2.921875 | 3 | [] | no_license | from collections import Counter
import numpy as np
trainingDataFilePath = 'training-100000.txt'
modelFilePath = 'model-10000000.model'
testDataFilePath = 'test_1000.txt'
resultFilePath = '2016081111_侯海洋.result'
'''
function:cut the string
parameter:
1.string:the input string
return:
1.type:list,mea... |
Ruby | UTF-8 | 722 | 2.671875 | 3 | [] | no_license | class WeatherAPI
require 'Unirest'
# def new
# WeatherAPI.new[:location]
# end
def self.get_weather(location)
response = Unirest.get "https://george-vustrey-weather.p.mashape.com/api.php?location=#{location}",
headers:{
"X-Mashape-Key" => "N4oUSJBSeymsh73eOWuHWwHSyjB7p1UmqkzjsnXCc7UMI3jnzD",... |
C# | UTF-8 | 2,960 | 2.53125 | 3 | [
"MIT"
] | permissive | using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using OniTemplate.Model;
using Xunit;
using YamlDotNet.Serialization;
using YamlDotNet.Serialization.NamingConventions;
namespace OniTemplate.Test
{
public class YamlTests
{
[Fact]
[Trait("Category", "Inte... |
PHP | UTF-8 | 9,035 | 2.796875 | 3 | [] | no_license | <?php
/**
* Simplified JS munger.
*
* @package munger-silverstripe-module
* @author Darren Inwood <darren.inwood@chrometoaster.com>
*/
class JS_Munger {
/**
* Default options
*/
public static $default_options = array(
// Header
'client' => false,
'project' => false,
... |
C++ | GB18030 | 3,003 | 4.0625 | 4 | [] | no_license | #include<iostream>
using namespace std;
const int MaxSize=100;//Ԫظ
class Set{//Set
int *data;//żеԪ
int n;//Ԫظ
public:
Set(){//캯
data=new int [MaxSize];//̬ռ
n=0;
}
~Set(){//
delete []data;
}
bool IsIn(int e){//жeǷڼ
int i;
for(int i=0;i<n;i++)
if(data[i]==e)
return ... |
SQL | UTF-8 | 6,306 | 3.515625 | 4 | [] | no_license | -- MySQL Script generated by MySQL Workbench
-- Sun Dec 6 13:44:41 2020
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ON... |
SQL | UHC | 9,623 | 4.25 | 4 | [] | no_license | [92] last_name߿ B, M, A ۵Ǵ ϼ.
select *
from employees
where last_name like 'B%' or last_name like 'M%' or last_name like 'A%';
select *
from employees
where instr(last_name,'B') = 1 or instr(last_name,'M') = 1 or instr(last_name,'A') = 1;
select *
from employees
where substr(last_name,1,1) in ('B','M','A');
[93... |
Java | UTF-8 | 1,459 | 2.25 | 2 | [] | no_license | package online.ors.oldraddisold.activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.View;
import java.util.Locale;
/**
* Activity for reaching out to ORS
*/
@SuppressWarnings("ConstantConditions")
public class Cont... |
Python | UTF-8 | 266 | 3.125 | 3 | [] | no_license | # 5/10/2020
# Select the first 1000 respondents
brfss = brfss[:1000]
# Extract age and weight
age = brfss['AGE']
weight = brfss['WTKG3']
# Make a scatter plot
plt.plot(age, weight,'o', alpha = 0.1)
plt.xlabel('Age in years')
plt.ylabel('Weight in kg')
plt.show() |
Markdown | UTF-8 | 1,656 | 3 | 3 | [
"MIT"
] | permissive | # Responsive Storefront
### Question
Using HTML, CSS and the supplied media, recreate the screens below in a responsive manner.
* The storefront consists of three main screens: a category list page, a product details page, and a cart page.
* None of the pages require any behaviour; they are completely static.
* You ar... |
Java | UTF-8 | 2,873 | 3.328125 | 3 | [] | no_license | /**
* Tests for Library assignment.
* Submitted By
* Ying Chen
* Chaitali Gondhalekar
*/
package library;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
* @author David Matuszek
*/
public class PatronTest {
private Patron dave;
priv... |
JavaScript | UTF-8 | 12,872 | 2.515625 | 3 | [
"MIT"
] | permissive | import React, { useState, useEffect} from 'react';
import { Link } from 'react-router-dom';
import "./StoreTwoDBsTwoTables.css";
import { useStorageSQLite } from 'react-data-storage-sqlite-hook/dist';
const StoreTwoDBsTwoTables = () => {
const [log, setLog] = useState([]);
const {openStore, getItem, setItem, get... |
Java | UTF-8 | 1,067 | 2.78125 | 3 | [] | no_license | public class testRemontService {
public static void main(String[] args) {
RemontService remontService = new RemontService();
Notebook myNotebook1 = new Notebook("ASUS TUF Gaming FX705", 6, "AMD Ryzen 7", 2020);
remontService.addComputer(myNotebook1);
remontService.addComputer(new Not... |
Go | UTF-8 | 5,485 | 2.890625 | 3 | [
"ISC"
] | permissive | /*
* Copyright (c) 2017-2020 The qitmeer developers
*/
package discover
import (
"context"
"time"
"github.com/Qitmeer/qitmeer/p2p/qnode"
)
const (
MinTableNodes = 5
PollingPeriod = 6 * time.Second
)
// lookup performs a network search for nodes close to the given target. It approaches the
// target by query... |
Python | UTF-8 | 228 | 3.078125 | 3 | [] | no_license | import json
import sys
def show_data(data, type='json'):
try:
data_to_be_shown = json.dumps(data, indent=4)
except RuntimeError:
print "Invalid data type."
sys.exit(0)
print data_to_be_shown
|
Python | UTF-8 | 1,599 | 3.15625 | 3 | [] | no_license | #
# @lc app=leetcode id=126 lang=python
#
# [126] Word Ladder II
#
# @lc code=start
class Solution(object):
def backtrack(self, result, trace, path, word):
if not trace[word]:
result.append([word] + path)
else:
for prev in trace[word]:
self.backtrack(result, ... |
Python | UTF-8 | 770 | 3.953125 | 4 | [] | no_license | '给定一个整型列表,如:lst =[1,5,2,7,4,9],指定的目标值为11,可以从中找出 2和9之和为11 '
import datetime
from functools import wraps
def logger(fn):
@wraps(fn)
def wrapper(*args, **kwargs):
start = datetime.datetime.now()
ret = fn(*args, **kwargs)
delta = (datetime.datetime.now() - start).total_seconds()
print('{} tooks {}s'.format(fn.__... |
Python | UTF-8 | 1,013 | 3.453125 | 3 | [] | no_license | def sanitize(time_string):
"""用.替换时间当中的- :"""
if '-' in time_string:
splitter = '-'
elif ':' in time_string:
splitter = ':'
else:
return(time_string)
(mins, secs) = time_string.split(splitter)
return(mins + '.' + secs)
"""定义函数读取数据"""
def get_coach_data(file_name):
... |
Markdown | UTF-8 | 455 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | ---
layout: feature
title: 'Gender'
shortdef: 'gender'
udver: '2'
---
`Gender` in Erzya is a peripheral phenomenon attested only occasionally/archaically in the [proper nouns](myv-pos/PROPN), where a woman is given the name of her husband with the -низэ `wife` suffix attached.
#### Examples
* [myv] _Иван ды <b>Иванн... |
Java | UTF-8 | 1,158 | 2.796875 | 3 | [
"Apache-2.0"
] | permissive | /*
* Copyright (c) 2017 xiaoniu, Inc. All rights reserved.
*
* @author chunlin.li
*
*/
package netty.authority.ch02.bio;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
/**
* 功能描述: 同步阻塞I/O (BIO)
* <p/>
* 创建人: chunlin.li
* <p/>
* 创建时间: 2018/06/23.
* <p/>
* Copyright (c) 凌霄... |
C | UTF-8 | 926 | 2.96875 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <malloc.h>
#include <stdlib.h>
#include <string.h>
char* chanbufe_str(char *s1, char *s2)
{
char *lastP, *p;
int k=0;
p = strstr(s1, s2);
while (p!='\n')
{
lastP = p++;
p = strstr(p, s1);
k++;
}
lastP = p;
if (lastP)
{
strcpy(lastP, lastP ... |
PHP | UTF-8 | 3,852 | 2.578125 | 3 | [] | no_license | <?php
//Disk Free
$df = disk_free_space("/");
$disk_space_free = get_int_symbol($df);
//Disk Total
$dt = disk_total_space("/");
$disk_space_total = get_int_symbol($dt);
//Disk Progress Bar
$get_ds_percent = get_percent($df, $dt);
$disk_available = 100 - $get_ds_percent;
//Memory
$memory_usage = get_server_memory_usa... |
JavaScript | UTF-8 | 2,784 | 2.859375 | 3 | [] | no_license | import React from "react";
import Task from './task';
import { useState } from "react";
import axios from "axios";
const TasksBox = () => {
const [newtasks, setnewtasks] = useState([]);
const [taskvalue, settaskvalue] = useState("");
function changehandler(event) {
settaskvalue(event.target.v... |
C# | UTF-8 | 32,712 | 2.8125 | 3 | [
"MIT"
] | permissive | using System;
using OpenCvSharp.Util;
namespace OpenCvSharp
{
/// <summary>
/// Matrix expression
/// </summary>
public sealed partial class MatExpr : DisposableCvObject
{
#region Init & Disposal
/// <summary>
///
/// </summary>
/// <param n... |
Java | UTF-8 | 4,001 | 2.265625 | 2 | [] | no_license | package cn.biggar.biggar.helper;
import android.support.v4.app.FragmentActivity;
import android.text.TextUtils;
import com.blankj.utilcode.util.AppUtils;
import com.blankj.utilcode.util.SPUtils;
import com.orhanobut.logger.Logger;
import cn.biggar.biggar.api.DataApiFactory;
import cn.biggar.biggar.app.Constants;
imp... |
PHP | UTF-8 | 1,231 | 2.75 | 3 | [] | no_license | <?php
class Report extends Dbh{
public function displayReports(){
$sql = "SELECT * FROM reports";
$stmt = $this->connect()->query($sql);
while ($row = $stmt->fetch()) {
echo "<div class='report container'>
<h4>Sms id:" .$row['sms_... |
Python | UTF-8 | 802 | 3.328125 | 3 | [] | no_license | #!/usr/bin/env python
"""
Opens an Apache server error log file and finds the top 25 errors
"""
# imports
import sys
from urllib.request import urlopen
# URL for testing: "http://icarus.cs.weber.edu/~hvalle/cs3030/data/error.log.test"
def help():
print("Usage is: ./riley_curtis_hw6.py <file Input>")
def get_err... |
Ruby | UTF-8 | 1,434 | 2.515625 | 3 | [] | no_license | class CartsController < ApplicationController
def show
cart_products = session[:shopping_cart][current_store.id]
if cart_products.empty?
@shopping_cart = []
else
@shopping_cart = cart_products.collect{|k,v|
[Product.unscoped.find(k), v]}
@orde... |
Java | UTF-8 | 978 | 2.375 | 2 | [] | no_license | package com.boa.cashfilm.item.dto;
public class Item {
private int myItemCode;
private String myItemName;
private int myItemAmount;
private String myItemExpiration;
public int getMyItemCode() {
return myItemCode;
}
public void setMyItemCode(int myItemCode) {
this.myItemCode = myItemCode;
}
public Stri... |
Markdown | UTF-8 | 635 | 2.625 | 3 | [] | no_license | # RiotEfficiencyTester
A program for calculating the most efficient spell in the game League of Legends, created by Riot Games.
Currently being refactored for style and general improvements due to putting this together in a weekend.
In the future, I plan to make this more usable for everyone instead of just my own de... |
C# | UTF-8 | 298 | 2.9375 | 3 | [] | no_license | public static string GetGeneratedQuery(this SqlCommand dbCommand)
{
var query = dbCommand.CommandTex;
foreach (var parameter in dbCommand.Parameters)
{
query = query.Replace(parameter.ParameterName, parameter.Value.ToString());
}
return query;
}
|
Markdown | UTF-8 | 3,506 | 2.859375 | 3 | [] | no_license | ---
id: hubs-cloud-aws-quick-start
title: AWS Quick Start
sidebar_label: AWS Quick Start
---
## Before creating the Hubs Cloud Stack
1. Create an account on AWS and log into the console.
2. Register or setup any domains in AWS Route 53, you'll need at least 2 domains. For example: `myhub.com` and `myhub.link`. See [D... |
Java | UTF-8 | 1,851 | 2.375 | 2 | [] | no_license | package example.jianghao.mvp.model;
import android.util.Log;
import java.util.ArrayList;
import java.util.List;
import example.jianghao.mvp.R;
import example.jianghao.mvp.bean.GirlBean;
/**
* girl model implementation v2.
* Created by jianghao on 2017/7/29.
*/
public class GirlModelImplV2 implements IGirlModel ... |
PHP | UTF-8 | 3,242 | 2.828125 | 3 | [] | no_license | <?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of th... |
PHP | UTF-8 | 767 | 2.546875 | 3 | [] | no_license | <?php
namespace Admin\Model;
use Think\Model;
class UserModel extends Model{
protected $tableName = "admin_user";
public function getUser($data){
$where['uname']=$data;
$user = $this->where($where)->find();
if($user){
return $user;
}else{
return false;
... |
Markdown | UTF-8 | 19,396 | 3.5 | 4 | [] | no_license | # javascript
### js能干什么(生机活力、强大)
1、进行数据验证(是否符合格式)
2、操作dom元素:内容、样式、属性
3、动态的创建、删除元素
4、动画
5、cookie()、本地存储
6、ajax(动态获取数据)
....
# js组成
### ECMAScript
> 基础语法:变量、数据类型、运算符、代码执行流程、函数、对象
### BOM(browser object model)
> 地址(url)、历史记录、DOM、屏幕、
### DOM(document object model)
> 节点、
## 引入方式
1、嵌入式:通过script标签写到任意位置
弹出... |
Python | UTF-8 | 2,218 | 2.5625 | 3 | [] | no_license | #!/usr/bin/env python
#
# This is a script testing all APIs of oandapy
#
import oandapy
import ConfigParser
from pprint import pprint
from datetime import datetime, timedelta
class Trade():
def __init__(self):
Config = ConfigParser.ConfigParser()
Config.read("./account.txt")
self.id = Conf... |
Java | UTF-8 | 1,776 | 2.34375 | 2 | [] | no_license | package com.otta.eventall.Utils;
import android.content.Context;
import android.content.SharedPreferences;
public class ConfidentialDB {
static SharedPreferences sharedPreferences;
static SharedPreferences.Editor editor;
static void Init(Context context) {
if (sharedPreferences == null) {
... |
C# | UTF-8 | 4,296 | 3 | 3 | [
"MIT"
] | permissive | using EuclideanGeometryLib.BasicMath.Tuples.Immutable;
using EuclideanGeometryLib.BasicMath.Tuples.Mutable;
using MeshComposerLib.Geometry.PathsMesh.Space3D;
using MeshComposerLib.Geometry.PointsPath.Space3D;
namespace MeshComposerLib.Composers
{
public sealed class YzGridComposer
{
/// <summary>
... |
JavaScript | UTF-8 | 8,213 | 2.953125 | 3 | [] | no_license | //Magic Trie Tree!!
class TrieNode {
constructor() {
this.children = new Map();
this.index = -1;
}
};
class Trie {
constructor() {
this.root = new TrieNode();
this.curNode = this.root;
this.size = 0;
}
addWord(word, index) {
this.curNode = this.root;
... |
PHP | UTF-8 | 22,070 | 2.578125 | 3 | [] | no_license | <?php
function buscarTipoContrato($frmBuscar) {
$objResponse = new xajaxResponse();
$valBusq = sprintf("%s|%s",
$frmBuscar['lstEmpresaBuscar'],
$frmBuscar['txtCriterio']);
$objResponse->loadCommands(listaTipoContrato(0, "id_tipo_contrato", "ASC", $valBusq));
return $objResponse;
}
function cargarLstClav... |
Markdown | UTF-8 | 7,036 | 2.765625 | 3 | [] | no_license |
## DOM (돔)
### 정의
- Document Object Model 그리고 문서 객체 모델이며 HTML 및 XML 문서를 위한 API이다.
- 이 DOM이란 트리 구조로 되어있는 객체 모델로써, Javascript가 getElementbyid()를 같은 함수를 이용하여 HTML문서의 각 요소(li, head같은 태그들)들을 접근하고 사용할 수 있도록 하는 객체 모델이다. 브라우저마다 DOM을 구현하는 방식은 다르기에 DOM이라는 것이 구체적으로 정해저 있는 언어나 모델과 같은 것은 아니다. 다만 웹페이지를 객체로 표현한 모델을 의미할 뿐이다.
####... |
Java | UTF-8 | 1,125 | 3.0625 | 3 | [] | no_license | import org.json.JSONObject;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
public class AccountService
{
private Map<Integer, Account> accountMap;
Integer counter = 1;
public AccountService()
{
counter = 1;
accountMap = new HashMap<Integer, Account>();
... |
C++ | UTF-8 | 2,266 | 3.734375 | 4 | [] | no_license |
//including libraries
#include<iostream>
#include<fstream>
#include <stdio.h>
#include <string>
#include <ctype.h>
using namespace std;
int sum[10][10]; // result of sum
int matrixC[10][10]; // result of multiplication
// this function add two matrices if their order are same and stores the result in a glob... |
Java | UTF-8 | 8,678 | 1.992188 | 2 | [] | no_license | package jp.co.inte.attendance.controller;
import java.text.MessageFormat;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import jp.co.inte.attendance.common.util.SystemConstant;
import jp.co.inte.attendance.entity.EmployGrade;
import jp.co.inte.attendance.entity.Useraccount;
import jp... |
Java | UTF-8 | 1,074 | 3.828125 | 4 | [] | no_license | package model;
import java.util.Random;
/**
* A random generator that picks items based on percent chance.
*/
public class RandomGenerator {
// EFFECTS: cannot be instantiated, as this is used for static method utilities
private RandomGenerator() {
}
// EFFECTS: returns a random index that is mor... |
C++ | UTF-8 | 1,871 | 2.78125 | 3 | [] | no_license | #include "src/GameEngine/hpp/MusicManager.hpp"
#include <iostream>
//definitions here, not in DEFINE.hpp
#define GAME_MUSIC_FILEPATH ""
namespace hgw
{
void MusicManager::LoopPlay(sf::Music &music, float soundVolume)
{
if (!muted)
{
if (music.getStatus() == music.Playing)
{
std::cout << "Music alread... |
Python | UTF-8 | 2,159 | 3.765625 | 4 | [] | no_license | # Universidad del Valle de Guatemala
# Cifrado de informacion
# Hugo Roman 19199
# Laurelinda Gomez 19501
# Juan Pablo Pineda 19087
# counter para contar las letras del texto plano
from collections import Counter
import matplotlib.pylab as plt
import numpy as np
# abecedario 27 letras
abc = 'ABCDEFGHIJKLMNÑOPQRSTUVWX... |
C++ | UTF-8 | 5,428 | 2.984375 | 3 | [] | no_license | #include "PC.h"
#include "Floor.h"
#include "Object.h"
#include "IOhandler.h"
#include "Dungeon.h"
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <climits>
//intialize instance pointer
PC *PC::s_instance = 0;
PC * PC::instance()
{
if (!s_instance) {
s_instance = new PC();
}
return s_instance;... |
Java | UTF-8 | 261 | 1.734375 | 2 | [] | no_license | package junitTest;
import org.junit.Test;
/*********************
*
*@Author: Jian Zhang
*@Date: 2017-07-17 16:39
*
*********************/
public class B_ModelTest {
@Test
public void _test(){
System.out.println("testing B model...");
}
}
|
Java | UTF-8 | 2,023 | 3.8125 | 4 | [] | no_license | /**********
NAME: Shoaib Khan
STUDENT NUMBER: 507285
ICS4U0-A, Sep-Jan 2016
THIS FILE IS PART OF THE PROGRAM: Stacks Assignment (The "LAN" class), uses Computer.java
Purpose: This class is used to set up and add attributes to the LAN stack. Includes methods to alter o... |
Shell | UTF-8 | 580 | 3.40625 | 3 | [] | no_license | # !/bin/sh
read -p 'Song: ' song
read -p 'Format(Press a for audio and v for video): ' song_type
read -p 'Location: ' location
if [ ${song_type:-a} == 'v' ]
then
song_type=video
a_or_v=-v
else
song_type=audio
a_or_v=-a
fi
if [ "${location:-0}" == 0 ];then
location=$HOME/Downloads/
fi
# Cannot download song wit... |
C++ | UTF-8 | 1,631 | 3.171875 | 3 | [] | no_license | #include<iostream>
using namespace std;
//#define POINTERS_BASICS
//#define POINTERS_AND_ARRAYS
#define POINTER_2_POINTER
void main()
{
setlocale(LC_ALL, "");
#ifdef POINTERS_BASICS
int a = 2;
int* pa = &a;
cout << a << endl; //Вывод значения переменной 'a' на экран.
cout << &a << endl; //Взятие адреса переменн... |
C++ | UTF-8 | 604 | 3.03125 | 3 | [] | no_license | #ifndef CONTAINER_H
#define CONTAINER_H
#pragma once
#include <vector>
#include <unordered_map>
#include <queue>
#include <stack>
#include <iostream>
using namespace std;
template <class T>
class Container {
private:
vector<T*> m_Arr;
queue<T*> m_DeletionList;
unordered_map<int, int> m_IdMap;
int m_Size;
Cont... |
SQL | UTF-8 | 811 | 3.328125 | 3 | [] | no_license |
--*****************************************************************************
-- SQL SERVER
--*****************************************************************************
select d.*, DD.DESCRICAO
from dbo.Dados d
, dadosdet DD
where (D.status & 4) = DD.CODIGO
/*
update dbo.Dados
set status = sta... |
Go | UTF-8 | 922 | 2.84375 | 3 | [] | no_license | package api
import (
"net/http"
"../controller"
"encoding/json"
"../models"
)
func GetAllData(w http.ResponseWriter, r *http.Request) {
visas := controller.GetAllData()
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
w.WriteHeader(http.StatusOK)
err := json.NewEncoder(w).Encode(visas);
if... |
Java | UTF-8 | 2,562 | 3.421875 | 3 | [] | no_license | // ATMThread.java
package cscie55.hw6;
import java.util.ArrayList;
/**
* This class is responsible for executing the requests in a request queue through ATMRunnable objects.
*
* @author Antonio Recalde Russo
* @version 11/23/2013
*
*/
public class ATMThread extends Thread
{
private ArrayList<ATMRunnable> reque... |
Java | UTF-8 | 835 | 1.851563 | 2 | [] | no_license | package com.restAssured;
import io.restassured.RestAssured;
import io.restassured.RestAssured;
import io.restassured.path.json.JsonPath;
import static io.restassured.RestAssured.*;
import static org.hamcrest.Matchers.*;
import files.Payload;
public class AddAssertion {
public static void main(String[] args) {
/... |
Java | UTF-8 | 1,202 | 2.375 | 2 | [] | no_license | package dressing.asi.insarouen.fr.dressing.data.model;
import dressing.asi.insarouen.fr.dressing.data.model.contenu.Vetement;
import dressing.asi.insarouen.fr.dressing.elements.Couleur;
/**
* Created by julie on 22/10/16.
*/
public class Contenu {
private Couleur couleur;
private String image;
private ... |
Python | UTF-8 | 889 | 3.90625 | 4 | [] | no_license | def grades():
sum=0
g=eval(input("Enter a grade:"))
while g>=0 and g<=100:
sum=sum+g
g=eval(input("enter next grade:"))
print("The sum of the grades is:",sum)
def number():
n=eval(input("enter a number:"))
if n==1:
n=eval(input("enter another number"))
... |
JavaScript | UTF-8 | 2,120 | 2.96875 | 3 | [] | no_license | // Get dependencies
const express = require('express');
const path = require('path');
const http = require('http');
const bodyParser = require('body-parser');
// Get our API routes
const api = require(path.join(__dirname, 'api', 'api.js'));
const app = express();
app.use(bodyParser.json());
/**
* Get port from envi... |
Swift | UTF-8 | 717 | 2.734375 | 3 | [] | no_license | //
// RandomFall.swift
// GiocoChimica
//
// Created by Antonio Mennillo on 20/11/2019.
// Copyright © 2019 Antonio Mennillo. All rights reserved.
//
import Foundation
import SpriteKit
extension SKSpriteNode {
func startFallingFromRandomPosition() {
//let random01 = CGFloat(Float(arc4random()) / Float(... |
Java | UTF-8 | 1,092 | 3.203125 | 3 | [] | no_license | import java.util.Scanner;
public class zigzag{
public static void main(String[] args){
Scanner scan;
scan = new Scanner(System.in);
String yes = "y";
int nStars = 0;
while(yes.equals("y") || yes.equals("Y")){
while (nStars<3||nStars>33){
Scanner m... |
Go | UTF-8 | 728 | 2.65625 | 3 | [
"MIT"
] | permissive | package telegraph_test
import (
"testing"
"github.com/stretchr/testify/assert"
"gitlab.com/toby3d/telegraph"
)
func TestCreateAccount(t *testing.T) {
t.Run("invalid", func(t *testing.T) {
t.Run("nil", func(t *testing.T) {
_, err := telegraph.CreateAccount(telegraph.Account{})
assert.Error(t, err)
})
... |
PHP | UTF-8 | 1,311 | 2.546875 | 3 | [] | no_license | <?php
/**
* productoCategoriaEshopTable
*
* This class has been auto-generated by the Doctrine ORM Framework
*/
class productoCategoriaEshopTable extends Doctrine_Table
{
/**
* Returns an instance of this class.
*
* @return object productoCategoriaEshopTable
*/
public static function g... |
C# | UTF-8 | 1,565 | 2.546875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using WebApi.Service.Interface.Table;
using WebApi.Models.Repository.EDI.Interface;
using WebApi.Models;
namespace WebApi.Service.Implement.Table
{
public class Budget_DepartmentReportService : IBudget_DepartmentReportService
{
private ... |
Markdown | UTF-8 | 2,993 | 2.796875 | 3 | [
"MIT"
] | permissive | ---
layout: about
title: H.J.Chang
permalink: /
description: Associate Professor @ <a href="https://www.ed.ac.uk" target="_blank">University of Birmingham</a>
profile:
align: right
image: team/HJ.jpg
address: <!-- >
<p>Informatics Forum</p>
<p>10 Crichton Street</p>
<p>Edinburgh, EH8 9AB</p> -->
ne... |
C# | UTF-8 | 1,441 | 3.5 | 4 | [
"MIT"
] | permissive | using System;
class Trip
{
static void Main()
{
double number = double.Parse(Console.ReadLine());
string season = Console.ReadLine();
if (number <= 100)
{
if (season == "summer")
{
number = (number * 30) / 100;
Console.W... |
PHP | UTF-8 | 1,666 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
namespace Despark\Cms\Console\Commands\User;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Storage;
/**
* Class CleanUserExports
*/
class CleanUserExports extends Command
{
/**
* The console command signature.
*
* @var string
*/
protected $signature = 'igni:user:e... |
Java | UTF-8 | 1,881 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | package com.popupmc.soloexperience.events;
import com.popupmc.soloexperience.SoloExperience;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org... |
Java | UTF-8 | 547 | 3.1875 | 3 | [] | no_license | package interfac_e;
/**
* 接口中可以定义“成员变量”,但是必须使用public static final 三个关键字修饰
* <p>
* <p>
* 接口中的常量遵循以下要求:
* 1. public static final 可以省略
* 2.接口的常量必须赋值
* 3.接口中的常量名必须全部大写,单词之间使用下划线隔开
* 4.通过 接口名 . 常量名来使用
* <p>
* <p>
* 接口不能有静态代码块 和构造方法
*/
public class InterfaceTest05 {
}
interface Person {
public static fina... |
Java | UTF-8 | 1,862 | 3.453125 | 3 | [] | no_license | public class Problem17 {
public static void main( String[] args ) {
long startTime = System.nanoTime();
String[] nums = new String[40];
nums[1] = "one";
nums[2] = "two";
nums[3] = "three";
nums[4] = "four";
nums[5] = "five";
nums[6] = "six";
nums[7] = "seven";
nums[8] = "eigh... |
Python | UTF-8 | 3,057 | 3.046875 | 3 | [] | no_license | import codecademylib
import pandas as pd
ad_clicks = pd.read_csv('ad_clicks.csv')
# Examine the first 10 rows of ad_clicks
print(ad_clicks.head(10))
# Variable views_from_utm_source to hold the total number of views from each utm_source
views_from_utm_source = ad_clicks.groupby('utm_source').user_id.count().reset_in... |
Markdown | UTF-8 | 197 | 2.96875 | 3 | [] | no_license | # Final: Accumulator Pattern
Given a string input by a user (like "hello"), return an object that counts the letters and then display the content within the HTML page.
```{h:1, e:1, l:2, o:1}```
|
PHP | UTF-8 | 297 | 2.765625 | 3 | [
"Apache-2.0"
] | permissive | <?php
try {
// buat koneksi dengan database
$pdo = new PDO('mysql:host=localhost;dbname=electrical', 'root', '');
}
catch (PDOException $e) {
// tampilkan pesan kesalahan jika koneksi gagal
print "Koneksi atau query bermasalah: " . $e->getMessage() . "<br/>";
die();
}
?> |
Java | UTF-8 | 331 | 2.03125 | 2 | [] | no_license | /**
*
*/
package socket;
import java.io.IOException;
/**
* @author ZHU Yuting
*
*/
public class Main {
/**
* @param args
*/
public static void main(String[] args) throws IOException {
System.out.println("Begin...");
MultiServer server = new MultiServer();
server.serv... |
JavaScript | UTF-8 | 1,085 | 3.25 | 3 | [] | no_license | document.getElementById('page-loaded').innerHTML =
(new Date()).toLocaleTimeString();
document.querySelector('button').addEventListener('click', getData);
document.querySelector('#get-html').addEventListener('click', getHtmlData);
function getData() {
const xhr = new XMLHttpRequest();
xhr.onreadystat... |
JavaScript | UTF-8 | 1,588 | 3.25 | 3 | [] | no_license | // target all panel elements
const panels = document.querySelectorAll('.panel');
// detail the maximum rotation assumed by the cards
const maxRotation = 45;
// retrieve the number of panels
// the idea is to use the index of each panel vis-a-vis this integer to rotate the cards in an arc
const { length } = panels;
/... |
Markdown | UTF-8 | 5,267 | 2.828125 | 3 | [] | no_license | ---
author:
name: shawkash
picture: 110759
body: "While I was suerfing, I found this strange site. And I thought you may like
to discuss this new way.\r\nhttp://www.dontclick.it\r\n\r\nDo you think that one
day we will surf the internet without useing our hands at all?"
comments:
- author:
name: Eric_West
... |
Markdown | UTF-8 | 930 | 3.375 | 3 | [] | no_license | # Path Finding Visualizer
This is visualization tool to visualize various path finding algorithms. There are various options to choose, like create a randomized maze, choose an algorithim to visualize and choose the heuristic to calculate. On pressing ```SPACE```, the code starts running.
## Algorithms
<ul>
<li> A... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.