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 |
|---|---|---|---|---|---|---|---|
C# | UTF-8 | 870 | 3.203125 | 3 | [] | no_license | // In a new Windows Forms Application, drop a GroupBox with a ComboBox and a CheckBox inside
// Then drop a TextBox outside the ComboBox. Then copy-paste.
// this goes somewhere in your project
public static class handlerClass
{
public static string ControlChanged(Control whatChanged)
... |
Python | UTF-8 | 7,638 | 2.6875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Mon Feb 17 17:35:51 2014
@author:Kristof Govaerts
Biomedical MRI Unit
KU Leuven
u0091609
Container class and functions for blood vessel analysis. Initiating an instance
of the VesselSkeleton class allows you to easily run various funct... |
C++ | UTF-8 | 1,982 | 2.625 | 3 | [] | no_license | #include "hero.h"
#include <iostream>
#include "mainwindow.h"
#include <QTransform>
#include "opponent.h"
#include <QApplication>
#include <QGraphicsTextItem>
Hero::Hero(int role, int id, const QString &name, int x, int y, int healthPercentage, int magicPercentage):Tile(x, y, 0)
{
this->_id = id;
this->_role... |
PHP | UTF-8 | 22,521 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | <?php
/**
* CodeGen short summary.
*
* CodeGen description.
*
* @version 1.0
* @author Jasim.Uddin
*/
require_once('JwtUtil.php');
require_once('StringBuilder.php');
class CodeGen
{
//private $navList;
private $mControllers;
private $layoutControllers;
private $componentsCSS;
public $app;
... |
Markdown | UTF-8 | 12,518 | 3.03125 | 3 | [] | no_license | Iii. the Sun and the Moon
=========================
"He it is Who appointed the Sun a splendour and the Moon a light, and
measured for her stages, that ye might know the number of the years, and
the reckoning. Allah created not (all) that save in truth. He detaileth
the revelations for people who have knowledge." Qura... |
C++ | UTF-8 | 745 | 3.453125 | 3 | [] | no_license | #include <cstdio>
#include <cstring>
using namespace std;
int lookpup[100] = { -1 };
int fibTopDown(int n) {
if (lookpup[n] == -1) {
if (n <= 1)
lookpup[n] = n;
else
lookpup[n] = fibTopDown(n - 1) + fibTopDown(n - 2);
}
return lookpup[n];
}
int fibBottomUp(int... |
Java | UTF-8 | 499 | 1.867188 | 2 | [] | no_license | package com.scut.knowbook.service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.scut.knowbook.model.Son_comments;
import com.scut.knowbook.model.User;
public interface ISonCommentsService{
public Son_comments findById(Long id);
public Son... |
C# | UTF-8 | 653 | 2.96875 | 3 | [
"MIT"
] | permissive | using System;
using System.Runtime.InteropServices;
namespace BrainfuckSharp.Cli
{
class Program
{
static void Main(string[] args)
{
var memory = new byte[1024];
while (TryReadLine(out var line))
{
try
{
var script = Brainfuck.Compile(line);
script.Inv... |
C | UTF-8 | 1,461 | 3.015625 | 3 | [
"GPL-1.0-or-later",
"LicenseRef-scancode-unknown-license-reference",
"GPL-2.0-only",
"BSD-2-Clause",
"MIT"
] | permissive | /* bwsolid.c
*
* 16-May-2008 Initial write: Ting Zhao
*/
#include <stdlib.h>
#include <stdio.h>
#include <utilities.h>
#include <string.h>
#include "tz_error.h"
#include "tz_stack_lib.h"
#include "tz_stack_bwmorph.h"
/*
* bwsolid - make objects in a binary stack more solid
*
* bwsolid [-mf value] infile -o outf... |
JavaScript | UTF-8 | 4,161 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | import { CONNECTION_TYPES, ADB_COMMANDS, ADB_SUBCOMMANDS } from './constants';
import _ from 'underscore';
const ADB_HEADER_LENGTH = 24;
function crc (buf) {
if (!buf) return 0;
let crcResult = 0;
// this loop doesn't want to be a let item of object loop
for (let i = 0; i < buf.length; i++) {
crcResult = (... |
Java | UTF-8 | 7,888 | 1.546875 | 2 | [
"Apache-2.0",
"MIT"
] | permissive | /*******************************************************************************
* Copyright © 2012-2015 eBay Software Foundation
* This program is dual licensed under the MIT and Apache 2.0 licenses.
* Please see LICENSE for more information.
*****************************************************************... |
Shell | UTF-8 | 380 | 3.265625 | 3 | [] | no_license | #this file is for dividing videos into frames.
#!/bin/bash
$cmd=""
while IFS='' read -r line || [[ -n "$line" ]]; do
echo $line
IFS='-' read -ra tmp<<<"$line"
l1=`expr ${tmp[1]} - 20`
l2=`expr ${tmp[0]} - ${tmp[1]} + 40`
echo ${l1}
cmd="$cmd && sudo ffmpeg -ss ${l1} -i {$2} -t ${l2} -vf fps=1 {... |
Markdown | UTF-8 | 1,324 | 2.75 | 3 | [
"MIT"
] | permissive | # Challenge4_Repo
Challenge 4 Repository
# User Story
Role: Quantitative analyst for a FinTech investing platform
Goal: This platform aims to offer clients a one-stop online investment solution for their retirement portfolios that’s both inexpensive and high quality.
Reason: To keep the costs low, through the u... |
Java | UTF-8 | 17,526 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | package stew6;
import java.io.*;
import java.sql.*;
import java.util.*;
import java.util.stream.*;
import javax.script.*;
import minestra.text.*;
import net.argius.stew.*;
import stew6.io.*;
import stew6.ui.*;
/**
* Command Processor.
*/
final class CommandProcessor {
private static Logger log = Logger.getLogg... |
Markdown | UTF-8 | 2,639 | 3.078125 | 3 | [
"MIT"
] | permissive | # XLSGenerator
Es una clase generadora de archivos XLS a partir de una matriz asociativa unidimensional, esto tiene la flexibilidad de poder utilizarse no solo para descargar archivos si no también para presentar tablas de datos.
### Instalación 🚀
```bash
$ composer require ligne/xls-generator
```
### Usos 📚
... |
Java | UTF-8 | 1,506 | 1.867188 | 2 | [] | no_license | package com.hwua.mall.controller;
import com.alibaba.fastjson.JSONObject;
import com.hwua.commom.dao.OrderMapper;
import com.hwua.mall.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.Re... |
Ruby | UTF-8 | 668 | 3.359375 | 3 | [] | no_license | require_relative 'person'
class Student < Person
attr_accessor :student_card, :interests, :is_graduated
def initialize access_card, name, interests = [], *args
super access_card, name
@interests = interests
@student_number = rand(666)
@is_graduated = false
@args = args
self.c... |
Shell | UTF-8 | 271 | 2.75 | 3 | [] | no_license | #!/bin/bash
# this checks to see if files created by Airserver's first run exist on a user account.
# if not, it will launch Airserver
if ! test -f ~/Library/Preferences/com.pratikkumar.airserver-mac.plist; then /Applications/AirServer.app/Contents/MacOS/AirServer
fi
|
Java | UTF-8 | 199 | 1.765625 | 2 | [] | no_license | package com.senior.test.litepaymentservice.share.model;
/**
* Franchise card values.
*
* @author <a href='carlos.suarez@payu.com'>Carlos Eduardo Suárez Silvestre</a>
*/
public enum FranchiseCard {
VISA,
AMEX,
MASTERCARD,
DINNER
}
|
TypeScript | UTF-8 | 4,009 | 2.6875 | 3 | [
"MIT"
] | permissive | import { marker, markerIndex } from './marker'
import { Part, AttrPart, PropPart, EventPart, NodePart } from './part'
import { Context } from './context'
import { isMarker } from './is'
import { cleanDofStr, insertAfter } from './dom'
import { UpdatableElement } from './component'
import { NotUpdatableELementError } fr... |
Markdown | UTF-8 | 896 | 2.546875 | 3 | [] | no_license | 以下代码经过测试通过,系统centos 6.3
## 一、匹配或
sed 匹配100_1000或bigger_1000
```
sed -n '/100_1000\|bigger_1000/p' 20160220
sed -n '/\(100_1000\|bigger_1000\)/p' 20160220
```
awk匹配100_1000或bigger_1000
默认是$0匹配,所以写不写均可
```
awk '/100_1000/||/bigger_1000/{print $0}' 20160220 | head
awk '$0~/100_1000/||/bigger_1000/{prin... |
Python | UTF-8 | 10,332 | 3.0625 | 3 | [] | no_license | import datetime
import pytz
import scipy
import numpy as np
import math
def calcLogR(data, delta=1):
"""
Calculates the log return of stock data over given time period.
The return is calculated over delta, where default delta = 1 weeks.
Data must be in format: dateTime, OHCLV.
Gaps in data for weekends and holid... |
PHP | UTF-8 | 645 | 3.0625 | 3 | [] | no_license | <?php
interface Export {
public function export();
}
class Json implements Export {
public function export()
{
return json_encode([__FUNCTION__]);
}
}
class Xml implements Export {
public function export()
{
return 'XML';
}
}
class PlainText implements Export {
public ... |
JavaScript | UTF-8 | 4,357 | 3.03125 | 3 | [
"MIT"
] | permissive |
import * as HumanGuiStrategy from './HumanGuiStrategy.js';
import * as HumanCliStrategy from './HumanCliStrategy.js';
import * as ComputerStrategy from './ComputerStrategy.js';
import * as HumanRemoteStrategy from './HumanRemoteStrategy.js';
import * as Timer from './util/Timer.js';
import * as Settings from './util... |
C | UTF-8 | 741 | 2.65625 | 3 | [] | no_license | #include <stdio.h>
#include "include/choice.h"
#include "include/comp_mode.h"
#include <stdlib.h>
#include "include/menu.h"
#include "include/rating.h"
void choice_comp(Profile *profile)
{
int number;
printf(" Your next step:\n\n");
printf(" ... |
Python | UTF-8 | 1,913 | 2.75 | 3 | [] | no_license | import ast
import json
from pyspark import SparkContext, SparkConf
from pyspark.rdd import RDD
from pyspark.streaming import StreamingContext
path = '../done_data/type/type_by_year.json'
def open_result():
try:
result = open(path, 'r', encoding='utf-8')
type_dict = json.load(result)
resu... |
Java | UTF-8 | 272 | 2.875 | 3 | [] | no_license | package mementopattern;
public class Record{
String state = null;
public Record(String state){
this.state = state;
}
public String getState(){
return state;
}
public void setState(String state){
this.state = state;
}
} |
Ruby | UTF-8 | 1,460 | 3.078125 | 3 | [] | no_license |
def parse_tag(string)
tag = {}
# save tag after < character
tag_type = string.match(/<(\w+)(?:>| )/)
# saves either side of an equal sign
attributes = string.scan(/(\w+)\s*=\s*['"](.*?)['"]/)
#options
options = string.scan(/\s*(\w)\s*[^=]/)
tag[:type] = tag_type[1]
attributes.each do |attrib... |
Java | UTF-8 | 1,078 | 2 | 2 | [
"Apache-2.0"
] | permissive | package test;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import com.alibaba.fastjson.JSON;
import com.my.springboot.demo... |
JavaScript | UTF-8 | 1,248 | 2.9375 | 3 | [] | no_license | app11.directive("player", function() {
// Create a directive object
var directive = {};
// Define that we are using an element directive instead of
// a A: attribute, C: class, or M: comment
// I covered how to apply as an attribute previously
// I normally only apply as elements or attributes... |
Java | UTF-8 | 13,784 | 3.515625 | 4 | [
"MIT-Modern-Variant"
] | permissive | package nachos.threads;
import nachos.machine.*;
import java.util.HashMap;
/**
* A <i>Rendezvous</i> allows threads to synchronously exchange values.
*/
public class Rendezvous {
/**
* Allocate a new Rendezvous.
*/
private nachos.threads.Lock lock;
private HashMap<Integer, Integer> tag_val;
... |
C++ | UTF-8 | 1,593 | 2.703125 | 3 | [
"BSL-1.0"
] | permissive | /*
* TEXT LAYOUT
* Copyright © 2018+ Ángel Rodríguez Ballesteros
*
* Distributed under the Boost Software License, version 1.0
* See documents/LICENSE.TXT or www.boost.org/LICENSE_1_0.txt
*
* angel.rodriguez@esne.edu
*
* C1802030140
*/
#include <basics/Text_Layout>
namespace basics
{
Text_Layout::Text... |
Java | UTF-8 | 1,792 | 2.921875 | 3 | [] | no_license | package com.ms.encryptsharing.dsa;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.SecureRandom;
p... |
Swift | UTF-8 | 4,496 | 2.875 | 3 | [] | no_license | //
// JSONParser.swift
// GitHubiOSAPI
//
// Created by Melaniia Hulianovych on 4/13/17.
// Copyright © 2017 Melaniia Hulianovych. All rights reserved.
//
import Foundation
import UIKit
class JSONParser {
func parseUserInfo(withdata data: NSDictionary) -> User {
let user = User()
if let n... |
Python | UTF-8 | 1,773 | 3.703125 | 4 | [] | no_license | # -*- coding: utf-8 -*-
# @Time : 2020/9/17 11:16 下午
# @Author : ddz
# 01 背包
# 描述:
# 有N件物品和一个容量为V的背包。
# 第i件物品的体积是vi,价值是wi。
# 求解将哪些物品装入背包,可使这些物品的总体积不超过背包流量,且总价值最大。
def backpack01(n, v, goods):
# 思路一:二维动态规划
# f[i][j] 前 i 个物品,体积为 j 的情况下,总价值最大
# 递推公式:
# 1. 不选第 i 个物品 f[i][j] = f[i-1][j]
# 2. 选第 i 个物品 f... |
Java | UTF-8 | 47,671 | 1.804688 | 2 | [
"MIT"
] | permissive | package com.ruoyi.project.deveagent.usertrapos.service.impl;
import com.ruoyi.common.constant.SysTableNameConstant;
import com.ruoyi.common.constant.TypeStatusConstant;
import com.ruoyi.common.utils.BasicSerivce;
import com.ruoyi.common.utils.json.NetJsonUtils;
import com.ruoyi.common.utils.security.ShiroUtils;
import... |
Java | UTF-8 | 10,049 | 2.28125 | 2 | [] | no_license | package com.example.atif.todolist;
import android.app.AlarmManager;
import android.app.DatePickerDialog;
import android.app.PendingIntent;
import android.app.TimePickerDialog;
import android.content.Context;
import android.content.Intent;
import android.icu.text.SimpleDateFormat;
import android.os.Bundle;
import andro... |
Java | UTF-8 | 2,074 | 2.15625 | 2 | [] | no_license | package pro.jianbing.aboutme.controller.user;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import pro.jianbing.aboutme.common.controller.BaseController;
import pro.... |
C# | UTF-8 | 11,824 | 2.625 | 3 | [] | no_license | /*
* 由SharpDevelop创建。
* 用户: Administrator
* 日期: 2015/3/27
* 时间: 16:02
*
* 要改变这种模板请点击 工具|选项|代码编写|编辑标准头文件
*/
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using System.ComponentModel;
using System.Data;
using System.Text;
using System.Threading;
using System.L... |
Go | UTF-8 | 3,303 | 3.03125 | 3 | [
"BSD-3-Clause"
] | permissive | package sqlmock
import (
"database/sql/driver"
"errors"
"fmt"
"testing"
)
type void struct{}
func (void) Print(...interface{}) {}
type converter struct{}
func (c *converter) ConvertValue(v interface{}) (driver.Value, error) {
return nil, errors.New("converter disabled")
}
func ExampleNew() {
db, mock, err :... |
TypeScript | UTF-8 | 3,761 | 2.84375 | 3 | [] | no_license | export interface IimageStock {
stock: priceAndEntities;
retraitemants: {
FNP: elementData[];
CCA: elementData[];
};
}
export interface IimageStockFinal extends IimageStock {
achats: elementData[];
ventes: elementData[];
}
interface elementData {
name: string;
entities: number;
priceTotal: numb... |
Swift | UTF-8 | 537 | 2.828125 | 3 | [] | no_license | //: Playground - noun: a place where people can play
import UIKit
var str = "Hello, playground"
let strin = String(format: "nesto %d hfshdj %d", 123, 12)
let z = 5435
let nesto = String(format : "http://adserver.iprom.net/adserver7/Click?z=%d;ad=140886;m=RTL;sid=vijesti_hr;ssid=novosti;flash=0;rdr=http%3A%2F%2Fwww%... |
Java | UTF-8 | 8,248 | 2.796875 | 3 | [] | no_license | import java.util.Scanner;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
//import java.io.FileOutputStream;
//import java.io.PrintWriter;
import java.util.StringTokenizer;
public class Main
{
public static KaiSevenIndex[] Index_kaiSeven;
public static int EndOfKaiSevenIndex;
public static int... |
Swift | UTF-8 | 363 | 2.515625 | 3 | [] | no_license | //
// DomainConvertible.swift
//
//
// Created by 이광용 on 2020/12/04.
//
import CoreData
protocol DomainConvertible: NSFetchRequestResult {
associatedtype DomainType
func asDomain() throws -> DomainType
static func fetchRequest() -> NSFetchRequest<Self>
}
enum DomainConvertError: Error {
... |
C++ | UTF-8 | 1,893 | 2.921875 | 3 | [] | no_license | #include "MapSearchNode.h"
#include "Mappa.h"
#include "Personaggio.h"
bool MapSearchNode::IsSameState( MapSearchNode &rhs )
{
return (x == rhs.x) && (y == rhs.y);
}
void MapSearchNode::PrintNodeInfo()
{
Personaggio::Instance()->setPers(x*80,y*80);
//Mappa::Instance()->setLvlmap(x,y);
cout << "Node ... |
C++ | UTF-8 | 1,470 | 3.0625 | 3 | [] | no_license | /**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode *buildTree(vector<int> &preorder, vector<int> &inorder) {
int n=preorder.size();
... |
C | UTF-8 | 427 | 3.46875 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
int main()
{
char str[20];
while (scanf("%s",str)!=EOF)
{
int i;
int num=0;
int count=0;
for (i=0;i<=11;i++)
{
if (str[i]!='-')
{
int temp=str[i]-'0';
num=num+(++count)*temp;
}
}
int ans = num % 11;
if (ans==str[12]-'0')
printf("Right\n")... |
Markdown | UTF-8 | 913 | 3.1875 | 3 | [] | no_license | # The-Android-App-Market-on-Google-Play
Introduction.
Mobile apps are everywhere. They are easy to create and can be lucrative. Because of these two factors, more and more apps are being developed. This project is a comprehensive analysis of the Android app market by comparing over ten thousand apps in Google Play acr... |
Python | UTF-8 | 1,255 | 3.546875 | 4 | [] | no_license | # -----------------------------------------------------------------------------
# Copyright (c) 2015, Nicolas P. Rougier. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -----------------------------------------------------------------------------
# Imports
import matpl... |
Java | UTF-8 | 1,303 | 2.171875 | 2 | [] | no_license | package com.unit.zxl.interceptor;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import org.sp... |
Markdown | UTF-8 | 976 | 2.53125 | 3 | [] | no_license | # Dirt Bike Unchained Hack 10k free tokens cheats mod android unlimtied cash tips
Dirt Bike Unchained Hack 10k free tokens cheats mod android unlimtied cash tips - Lots of people knows that it is hard to achieve high level in Dirt Bike Unchained without free tokens and unlimite cash. Not everyone can afford to spend h... |
Python | UTF-8 | 322 | 2.875 | 3 | [] | no_license | class Control:
#takes charID from rules and sends to Location
def initializeCharacters(self,charID):
Control.l.addID(charID)
print("charid added to location")
#pass a reference to the Location class so that we can access it.
def __init__(self,L):
Control.l... |
Markdown | UTF-8 | 2,493 | 3.46875 | 3 | [] | no_license | # PHP 與 MySQL 的互動:刪除資料
### HULI 範例
```php=
<?php
//連結 local host
require_once('conn.php');
//預防空白輸入
if (empty($_GET['id'])) {
die('請輸入 id');
}
//request method
$id = $_GET['id'];
$sql = sprintf(
"delete from users where id = %d",
$id
);
echo $sql . '<br>';
$result = $conn->query($sql);... |
Go | UTF-8 | 1,170 | 3.859375 | 4 | [] | no_license | package main
import (
"bufio"
"fmt"
"log"
"os"
"strconv"
)
// ComputeFuelForMassRecursively return fuel needed to move a module based on its mass plus an accumulator
func ComputeFuelForMassRecursively(accumulator int, mass int) int {
res := mass/3 - 2
if res < 0 {
return accumulator
}
return ComputeFuelFor... |
Java | UTF-8 | 160 | 1.914063 | 2 | [] | no_license | package theGardener.powers;
import theGardener.garden.structures.AbstractPlant;
public interface OnHarvestSubscriber {
void onHarvest(AbstractPlant p);
}
|
Python | UTF-8 | 16,437 | 2.609375 | 3 | [] | no_license | import board
import neopixel
import time
import datetime
import logging
from datetime import timezone
import numpy
import json
from skyfield.api import N, W, wgs84, load, utc
from skyfield.almanac import find_discrete, risings_and_settings
#initialize log
logging.basicConfig(filename='main.log', format='%(asctime)s %(... |
Shell | UTF-8 | 1,351 | 3.59375 | 4 | [] | no_license | #!/bin/bash
#Script to execute the commands!
DATE=$(date '+%m-%d-%Y');
filename="${DATE}.txt"
num=0
while [ -f $filename ]; do
num=$(( $num + 1 ))
filename="${DATE}--${num}.txt"
done
touch $filename
dt=$(date '+%m/%d/%Y %H:%M:%S');
echo -e Hi there,"\n" >> $filename
echo -e At $dt, the following commands wer... |
Python | UTF-8 | 7,305 | 3.390625 | 3 | [
"MIT"
] | permissive | import pytest
def test_dice_roll():
"""Test that the output of a dice roll is a list"""
from main import roll_dice
assert type(roll_dice()) == list
def test_many_dice():
"""Test that when 3 dice are rolled, three numbers come out"""
from main import roll_dice
assert len(roll_dice(num_die=3))... |
C# | UTF-8 | 19,599 | 2.953125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using ARMSim.Preferences;
using ARMSim.Simulator;
namespace ARMSim.GUI.Views
{
/// <summary>
/// This class manages the WatchV... |
Java | UTF-8 | 3,212 | 2.234375 | 2 | [] | no_license | package com.example.george.ommfcm;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Filter;
import android.widget.TextView;
import com.google.android.gms.plus.People;
import java.util... |
PHP | UTF-8 | 3,507 | 2.78125 | 3 | [] | no_license | <?php
class excelWorkbook {
private $Worksheets ;
private $Styles ;
function __construct() {
$this->Worksheets = array() ;
$this->Styles = array() ;
}
function __destruct() {
}
function __set($property, $value) {
$this->$property = $value;
}
function __get($property) {
if (isset($t... |
Ruby | UTF-8 | 155 | 3.109375 | 3 | [] | no_license | class Note
def create
print "Enter your tag:"
tag = gets.chomp()
print "Enter your note:"
note = gets.chomp()
[tag,note]
end
end
|
Java | UTF-8 | 2,816 | 3.15625 | 3 | [] | no_license | package br.com.exer2;
import java.util.Scanner;
/**
* Created by BRUNO on 06/09/2017.
*/
public class Comida {
private double tottal;
public static enum Bebidas {
PEPSI("Pepsi", 4.0), SUCO("suco", 3.0), AGUA("agua", 3.5);
private String nome;
private double preco;
publ... |
Java | UTF-8 | 1,839 | 2.203125 | 2 | [] | no_license | /**
*
*/
package com.lti.action.mutualfund;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import com.lti.action.Action;
import com.lti.system.ContextHolder;
import com.opensymphony.xwork2.ActionSupport;
import com.lti.service.SecurityManager;
import com.lti.service... |
C | UTF-8 | 2,740 | 2.875 | 3 | [
"MIT"
] | permissive | /**
* registry.c
*
* Simple program for exploring the wayland registry.
* I have not been able to find documentation on what interfaces will
* consistently be in the registry, and if they have consistent names (ids).
*
* Copyright 2019 by Joshua Gutow
*
* Permission is hereby granted, free of charge, to any pe... |
Python | UTF-8 | 934 | 2.6875 | 3 | [] | no_license | from flask import request
from flask_api import FlaskAPI, status, exceptions
import json
from modules import MicroController as mc
app = FlaskAPI(__name__)
@app.route("/state", methods=['GET'])
def get():
"""
GET : returns the item state with 2** status code
4**, 5** accordingly if MicroControll... |
Markdown | UTF-8 | 1,617 | 3.65625 | 4 | [] | no_license | **Iteratiu**
* Tenemos un bucle dentro de un bucle, el primero mira si el numero es mayor que 9, el segundo suma todos los digitos
```
while aux:
sumatori += aux % 10
aux //= 10
```
* El Coste de este bucle interno es, en resumen, el numero de digitos de aux ( Mas constantes)
* Com... |
TypeScript | UTF-8 | 9,920 | 2.765625 | 3 | [] | no_license | /**
*
* Elijah Cobb
* elijah@elijahcobb.com
* https://elijahcobb.com
*
*
* Copyright 2019 Elijah Cobb
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including ... |
Ruby | UTF-8 | 559 | 2.625 | 3 | [] | no_license | # frozen_string_literal: true
require 'httparty'
module Formulary
# This class reads QHP data from a list of urls and loads it into a repository
class QHPImporter
attr_reader :urls, :repo
def initialize(urls, repo)
@urls = urls
@repo = repo
end
def import
urls.each do |url|
... |
C# | UTF-8 | 1,059 | 2.53125 | 3 | [
"MIT"
] | permissive | public class ViewExistingStudentsScenario
{
public ViewExistingStudentsScenario()
{
_fixture = new DatabaseFixture();
_controller = new StudentController(new StudentRepository(_fixture.Context));
}
public void GivenExistingStudents()
{
var expectedStudents = new List<Student>
{
new Student(... |
Java | UTF-8 | 4,724 | 1.976563 | 2 | [] | no_license | package allinter.lowvision;
import allinter.BrowserTab;
import allinter.LowVisionOptions;
import org.eclipse.actf.model.ui.ImagePositionInfo;
import org.eclipse.actf.model.ui.editor.browser.ICurrentStyles;
import org.eclipse.actf.visualization.engines.lowvision.LowVisionException;
import org.eclipse.actf.visualization... |
Markdown | UTF-8 | 795 | 2.578125 | 3 | [
"MIT"
] | permissive |
# Project-1

## Description
this is a node based project to generate reademe
## Table of Contents
* [Installation](#Installation)
* [Usage](#Usage)
* [License](#License)
* [Contributing](#Contributing)
* [Tests](#Tests)
* [Questions](#Que... |
Java | UTF-8 | 4,768 | 2.5 | 2 | [] | no_license | package com.im.websocket;
import java.io.IOException;
import javax.websocket.OnClose;
import javax.websocket.OnError;
import javax.websocket.OnMessage;
import javax.websocket.OnOpen;
import javax.websocket.Session;
import javax.websocket.server.ServerEndpoint;
import com.google.gson.Gson;
import com.im.d... |
Java | UTF-8 | 7,722 | 2.140625 | 2 | [] | no_license | package org.port.trade.activity;
/**
* Created by 超悟空 on 2015/3/3.
*/
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.NavUtils;
import android.support.v4.app.TaskStackBuilder;
import android.... |
Python | UTF-8 | 2,797 | 2.734375 | 3 | [] | no_license | #!/usr/bin/python
import time
import os
from sys import argv
import sendmail
import re
import xml.etree.ElementTree as ET
import logging
class LogEventMonitorError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class ConfigError(LogE... |
C++ | UTF-8 | 1,424 | 2.859375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
class graph{
int v;
// list<int> *adj;
unordered_multimap <int,int> adj;
public:
graph(int v){
this->v=v;
}
void addEdge(int u,int v){
adj.emplace(v,u);
adj.emplace(u,v);
}
void bfs(int s){
vector<bool>... |
Python | UTF-8 | 124 | 3.4375 | 3 | [] | no_license | ### programa responsavel por printar 5 vezes "Hello World" na forma de String
for i in range(5):
print ("Hello World")
|
PHP | UTF-8 | 1,439 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
/**
* User: cfn <cfn@leapy.cn>
* Datetime: 2021/8/20 9:33
* Copyright: php
*/
namespace unionpay\Kernel\Traits;
use Exception;
use Symfony\Component\HttpFoundation\Response;
/**
* Class PaymentNotifyHandle
*
* @package unionpay\Kernel\Traits
*/
trait PaymentNotifyHandle
{
/**
* @var string
... |
Python | UTF-8 | 491 | 4.0625 | 4 | [] | no_license | # Coursera Python Training 2
# Lucas Silva
# Week 1 - Exercício 2 - Soma de Matrizes
def soma_matrizes(m1,m2):
if len(m1)==len(m2) and len(m1[0])==len(m2[0]):
m3=[]
for i in range(0,len(m1)):
linha=[]
for j in range(0,len(m1[0])):
linha.append(m1[i][j] + m2... |
JavaScript | UTF-8 | 5,040 | 2.515625 | 3 | [] | no_license | /// <reference types="cypress" />
context('Happy Path', () => {
// Select the 1st case
it('should select the case', () => {
cy.visit('https://learning.elucidat.com/course/5c9126fd760e5-60ba4c3fe8135')
cy.get('h1.projectTitle').should('contain','FINDING THE TRUTH');
cy.get('.add... |
Python | UTF-8 | 635 | 3.40625 | 3 | [] | no_license | from sys import argv
script , filename = argv
print "WE are going to erase %r" % filename
print "if you dont want that hit CTRL-C (^C)"
print "If you do want that hit Return "
raw_input("?")
print "opening file ..."
target = open(filename,'w')
print "Turnicating the file day Goodbye ! "
target.truncate()
print " N... |
C++ | UTF-8 | 1,680 | 2.953125 | 3 | [] | no_license | #include "Stats.h"
#include <string>
#include <fstream>
#include <windows.h>
#include <vector>
#include <iostream>
Stats::Stats()
{
GetUserName(profile, &profile_len);
profile_name = profile;
}
void Stats::stat()
{
std::ofstream cf;
cf.open("C\:\\Users\\" + profile_name + "\\Desktop\\CharacterFile.... |
Markdown | UTF-8 | 456 | 2.90625 | 3 | [] | no_license | ### 声明空间
两种声明空间: 类型声明空间和变量声明空间
##### 类型声明空间
包含用来当做类型注解的内容
出现错误提示: cannot find name 'Bar' 的原因是名称 Bar 并未定义在变量声明空间。
##### 变量声明空间
#### 基本注解
```ts
const num: number = 123;
function identity(num:number):number {
return num;
}
const identify = (num:number):number=>{
return num;
}
```
|
Java | UTF-8 | 5,749 | 2.265625 | 2 | [] | no_license | package com.example.vanosidor.moxygithubrepositories.ui.mvp.presenter;
import android.util.Log;
import com.arellomobile.mvp.InjectViewState;
import com.example.vanosidor.moxygithubrepositories.ui.GithubApp;
import com.example.vanosidor.moxygithubrepositories.ui.database.RepositoriesDao;
import com.example.vanosidor.m... |
Python | UTF-8 | 1,258 | 3.609375 | 4 | [] | no_license | from collections import namedtuple
# 1. списки смежности
graph = []
graph.append([1, 2])
graph.append([0, 2, 3])
graph.append([0, 1])
graph.append([1])
print(graph)
print(*graph, sep='\n')
# как проверить что из вершины 1 мы попадем в вершину 3?
# - перебрать весь список
print('*' * 50)
# 2. ориентированный граф
... |
TypeScript | UTF-8 | 2,787 | 2.609375 | 3 | [] | no_license | module com {
export module google {
export module analytics {
export module campaign {
export class CampaignTracker extends egret.HashObject {
public content:string;
public id:string;
public clickId:string;
public name:string;
public term:string;
public medium:string;
public... |
Python | UTF-8 | 3,399 | 3.53125 | 4 | [] | no_license | import pandas as pd
import matplotlib.pyplot as plt
import datetime as dt
import calendar
# https://github.com/QCaudron/pydata_pandas -- based from
# Temporary fix to print() not showing newline at the end
nl = "\n"
coffeeData = pd.read_csv("data/coffees.csv")
# ===== Showing Data =====
# Print first 5 rows(da... |
Python | UTF-8 | 2,094 | 3.578125 | 4 | [] | no_license | # encoding=utf-8
# -,- 回头理解清楚一下
class Solution(object):
def recur_search(self, left, right, nums, target):
if left == right:
if nums[left] == target:
return left
else:
return -1
mid = (left + right) / 2
if nums[mid] == target:
... |
Java | UTF-8 | 5,279 | 2.84375 | 3 | [
"MIT"
] | permissive | public class LagObserver {
private static int groupsize = 3; // 1 ... 24
private static int managerLagLevel = 1;
public static int groupsize() {
return groupsize;
}
public static int getManagerLagLevel() {
return managerLagLevel;
}
public static int managerRotationSize() { // 7, 14, 21, 28
return MA... |
Shell | UTF-8 | 8,666 | 2.609375 | 3 | [] | no_license | # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$H... |
JavaScript | UTF-8 | 414 | 3.15625 | 3 | [] | no_license | class Tanker {
constructor(x, y, width, height) {
var options = {
isStatic: true
}
this.body = Bodies.rectangle(x, y, width, height, options);
this.width = width;
this.height = height;
this.x= x;
this.y= y;
};
display(){
var pos =this.body.position;
fill(... |
PHP | UTF-8 | 18,171 | 2.609375 | 3 | [] | no_license | <?php
class SQLiquid {
protected $_init_done;
protected $_null_result;
protected $_where;
protected $_or_where;
protected $_join;
protected $_groupby;
protected $_order;
protected $_debug;
protected $_pretend;
protected $_cols;
protected $_fields;
protected $_table;
public $_db;
/**
* Can instantia... |
Python | UTF-8 | 551 | 3.375 | 3 | [] | no_license | from bs4 import BeautifulSoup
import requests
def scrapeSite(url,out):
r = requests.get(url)
txt = r.text
htmlCode = BeautifulSoup(txt,'html.parser')
if htmlCode.h1:
ans = htmlCode.find_all('h1')
for i in ans:
out.write(str(i.string) + "\n")
if htmlCode.p:
ans = ... |
Java | WINDOWS-1250 | 6,611 | 2.96875 | 3 | [] | no_license | package us.lsi.graphs.search;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.Optional;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.Predicate;
imp... |
Java | UTF-8 | 3,700 | 2.21875 | 2 | [] | no_license | package vn.wae.spring.entity;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.validator.constraints.NotBla... |
JavaScript | UTF-8 | 925 | 2.53125 | 3 | [
"MIT"
] | permissive | import * as React from 'react';
import Action from '../actions/TodoAction';
import Store from '../stores/TodoStore';
class ListItem extends React.Component {
constructor(props){
super(props);
this.onClickHandler = this.onClickHandler.bind(this);
this.action = new Action();
}
onClick... |
C++ | UTF-8 | 603 | 2.984375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int trapRainWater(const vector<int>&v)
{
int size=v.size();
vector<int>lMax(size),rMax(size);
lMax[0]=v[0];
for(int i=1;i<size;i++)
{
lMax[i]=max(lMax[i-1],v[i]);
}
rMax[size-1]=v[size-1];
for(int j=size-2;j>=0;j--)
{
rMax[... |
JavaScript | UTF-8 | 2,695 | 3.171875 | 3 | [] | no_license |
var Hamming = function(n){//2 to the n bits of parity
var blockSize = 1<<n;
var blockDataSize = blockSize - n - 1;
this.encode = function(bits){
var blocks = [];
var idx = 0;//index of the bit
while(idx < bits.length){
var block = [0];
blocks.push(... |
Java | UTF-8 | 28,664 | 1.9375 | 2 | [] | no_license | package com.ratio.deviceService.data;
import android.content.Context;
import android.util.Log;
import com.ratio.deviceService.accessory.AccessoryConfig;
import com.ratio.deviceService.communication.provider.SleepDetailDB;
import com.ratio.deviceService.communication.provider.SleepDetailTB;
import com.ratio.deviceServ... |
JavaScript | UTF-8 | 590 | 4.03125 | 4 | [
"MIT"
] | permissive | /* How to generate a Factorial number
*/
//Create a big-integer class
var bigInt = require("big-integer");
//This function returns the factorialization of nonnegative integer, and
//makes use of the big-integer datatype.
//@param index the integer to be factorialized
function factorial(index) {
if(index < 1 || isNaN... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.