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 |
|---|---|---|---|---|---|---|---|
Java | UTF-8 | 300 | 1.632813 | 2 | [] | no_license | package codeOrchestra.flex.processors.transparent;
import jetbrains.mps.smodel.SNode;
/**
* @author Anton.I.Neverov
*/
public class E4XConditionProcessor extends ParenthesizedExpressionProcessor {
public E4XConditionProcessor(SNode node) {
super(node);
childName = "condition";
}
}
|
TypeScript | UTF-8 | 784 | 3.59375 | 4 | [] | no_license | import { Sorter } from "./Sorter";
export class NumbersCollection extends Sorter{
constructor (public data: number[]) {
super();
};
/*
Notice that the below is equal to line 2:
data: number[];
constructor (data: number[]) {
this.data = data;
}
*/
get length(): number {
return this.dat... |
Markdown | UTF-8 | 4,388 | 3.890625 | 4 | [
"MIT"
] | permissive | # Agenda
1. [Why functional programming?](#/2)
1. [Why elixir?](#/3)
1. [Basic types & Operators](#/4)
1. [Pattern matching](#/5)
1. [Functions](#/6)
1. [Recursion](#/7)
1. [Concurrency](#/8)
# Why FP?
- Abstractions
- Immutability
- DSLs
- Concurrency
#Why elixir?
- Runs on the Erlang VM
- Reuse Erlang libr... |
Java | UTF-8 | 1,684 | 2.40625 | 2 | [] | no_license | package org;
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;
public class Ac... |
C# | UTF-8 | 2,152 | 3.421875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GraphsAndTreesAlgorithms.Graphs
{
public class GraphDistanceCalculator
{
public IDictionary<string, double> CalculateDistances(Graph graph, string startingNode)
{
... |
Java | UTF-8 | 418 | 2 | 2 | [] | no_license | package com.nestor.common;
/**
* <p>业务异常类</p>
*
* @author bianzeyang
*
*/
public class BizException extends BaseException {
/**
*
*/
private static final long serialVersionUID = 4648866296534704666L;
private static final int BIZException_CODE = 48; // 业务异常code
public ... |
C | UTF-8 | 977 | 3.546875 | 4 | [] | no_license | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* struct TreeNode *left;
* struct TreeNode *right;
* };
*/
int sumOfLeftLeaves(struct TreeNode* root) {
int sum=0;
struct TreeNode* tmp = root;
struct TreeNode* left;
struct TreeNode* right;
if(tmp==NULL)... |
Java | UTF-8 | 140 | 1.976563 | 2 | [] | no_license | package daytrader.gui;
import java.awt.*;
public interface IBlotter {
void onTrade(String trade);
Component getComponent();
}
|
Go | UTF-8 | 172 | 2.890625 | 3 | [] | no_license | package main
import "fmt"
func main() {
c := make(chan int, 1) //buffer : 1
c <- 42
c <- 43
fmt.Println(<-c)
//fatal error: all goroutines are asleep - deadlock!
}
|
Java | UTF-8 | 1,336 | 2.3125 | 2 | [
"MIT"
] | permissive | package cloud.jgo.net.tcp.http.jor.annotations;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import cloud.jgo.net.tcp.http.jor.ResponseType;
@Retention... |
Java | UTF-8 | 1,424 | 2.40625 | 2 | [] | no_license | package com.lr.simplerpc.zookeeper;
import com.lr.simplerpc.common.constant.Constant;
import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.ZooKeeper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.concurrent.C... |
C++ | UTF-8 | 3,180 | 3.40625 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <stdlib.h>
#include "LinkedList.h"
#include "BST.h"
// g++ -std=c++11 LinkedList.cpp BST.cpp assignment6.cpp -o assignment6
// ./assignment6 Hemingway_edit.txt >> output.txt
void compareOps(int numLines, char *arg);
using namespace s... |
C# | UTF-8 | 1,367 | 2.671875 | 3 | [] | no_license | <Query Kind="FSharpProgram" />
// unshorten urls
open System.Net
let urls = [
"http://goo.gl/zdf2n"
"http://tinyurl.com/8xc9vca"
"http://x.co/iEup"
"http://is.gd/vTOlz6"
"http://bit.ly/FUA4YU"
]
type unshortenResult =
| Success of status:HttpStatusCode*url:string
| Failure of HttpStatusCo... |
TypeScript | UTF-8 | 420 | 3.671875 | 4 | [] | no_license | interface ObjectValue {
category: string;
product?: string;
}
const show = ({category, product}: ObjectValue) => console.log(category, product);
show({category: 'Categoria'});
const obj: ObjectValue = {category: 'Categoria 1', product: 'Product 1'};
class Product implements ObjectValue {
category: strin... |
Python | UTF-8 | 4,185 | 3.40625 | 3 | [] | no_license | import os
import sys
import argparse
def get_args():
"""Parses input arguments."""
print(f"Init: Parsing command line arguments.")
parser = argparse.ArgumentParser(
description="Program to generate CSV list of pairs of artists appearing together at least 50 times in the "
"inpu... |
Python | UTF-8 | 24,550 | 2.765625 | 3 | [
"MIT"
] | permissive | import io
import numpy as np
import os
import pygtrie
import tempfile
# shared global variables to be imported from model also
UNK = "$UNK$"
NUM = "$NUM$"
NONE = "O"
# special error message
class MyIOError(Exception):
def __init__(self, filename):
# custom error message
message = """
ERROR: Unab... |
Java | UTF-8 | 1,571 | 2.171875 | 2 | [] | no_license | package com.ustcsoft.jt.controller;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.ustcsoft.jt.mybatis.Page;
import com.ust... |
Java | UTF-8 | 1,757 | 3.5 | 4 | [] | no_license |
import java.util.Random;
class Student
{
Random random = new Random();
int id;
String name;
String faculty;
public void SetFaculty()
{
int ranNum = random.nextInt(3) + 1;
switch (ranNum)
{
case 1:
... |
C | UTF-8 | 5,692 | 2.640625 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<unistd.h>
#include <sys/wait.h>
#include<fcntl.h>
char *inputfile;
char *outputfile;
void shell_loop();
char* shell_readline();
void outputredirect(char*);
void inputredirect(char*);
char **shell_splitcommand(char*);
char **shell_splitpipes(char*);
voi... |
Java | UTF-8 | 394 | 1.953125 | 2 | [] | no_license | package com.smartparkinglot.backendservice.repository;
import com.smartparkinglot.backendservice.domain.ParkingLot;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
public interface ParkingLotRepository extends JpaRepository<ParkingLot,Long> {
ParkingLot findByName(String name... |
SQL | UTF-8 | 3,762 | 3.8125 | 4 | [] | no_license | -- --------------------------------------------------------------------------------
-- Routine DDL
-- --------------------------------------------------------------------------------
DELIMITER $$
DROP PROCEDURE IF EXISTS `sp_empresa_insert` $$
CREATE PROCEDURE `sp_empresa_insert`(
in sp_in_str_nome varc... |
PHP | UTF-8 | 591 | 2.53125 | 3 | [] | no_license | <?php
/**
*
* @package tmvc
* @author Codilar Technologies
* @license https://opensource.org/licenses/OSL-3.0 Open Software License v. 3.0 (OSL-3.0)
* @link http://www.codilar.com/
*/
namespace Tmvc\Framework\Router;
class Manager
{
private $_routerPool;
public function __construct... |
Markdown | UTF-8 | 3,529 | 3.15625 | 3 | [] | no_license | ---
layout: post
title: "When to make a Git commit"
date: 2017-01-10 19:37
comments: true
categories:
- Git
description: '2 rules I follow for when to make commits.'
subheading: '2 rules I follow for when to make commits.'
excerpt: '2 rules I follow for when to make commits.'
---
You don't have to look through too m... |
TypeScript | UTF-8 | 486 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | import type { CollectionItem } from '../../types/eleventy.js';
export function firstWithTag(tag: string, items: CollectionItem[]): CollectionItem | undefined {
return items?.find(item => {
return !!item.data?.tags?.find(itemTag => itemTag === tag);
});
}
export function findByTag(tag: string, items: Collectio... |
Java | UTF-8 | 4,283 | 3.453125 | 3 | [] | no_license | package slutprojekt;
import java.util.*;
public class Gamble {
public static void main(String[] args) {
Scanner user_input = new Scanner(System.in);
/*Jag skapar strängar för alla kortvalörer och kortvärden.*/
String[] kortvalör = {"Hjärter", "Spader", "Ruter", "Klöver"};
String... |
Markdown | UTF-8 | 299 | 2.6875 | 3 | [] | no_license | # Article R3252-41
Si le créancier transfère son domicile, il en avise le greffe, à moins qu'il n'ait comparu par mandataire.
**Liens relatifs à cet article**
**Anciens textes**:
- Code du travail - art. R145-36 (Ab)
**Créé par**:
- Décret n°2008-244 du 7 mars 2008 - art. (V)
|
Java | UTF-8 | 2,292 | 1.773438 | 2 | [] | no_license | /*
* Copyright © 2007 Manhattan Associates All rights reserved. Do not copy, modify or redistribute this file without specific written permission from Manhattan Associates.
*/
package com.manh.wmos.services.outbound.service;
import com.manh.wmos.services.outbound.data.RFPackFromToteData;
public interface TMWI... |
Java | UTF-8 | 4,841 | 1.96875 | 2 | [] | no_license | package com.wso2telco.services.dep.sandbox.servicefactory.walletConfig;
import java.util.ArrayList;
import java.util.List;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import org.apache.commons.logging.LogFactory;
import com.wso2telco.core.dbutils.exception.ServiceError;
import com.wso... |
Python | UTF-8 | 103 | 3.03125 | 3 | [] | no_license | print('Marcelo', type('Marcelo'))
print(10, type(10))
print(2.5, type(2.5))
print(10==10, type(10==10)) |
Python | UTF-8 | 1,169 | 2.875 | 3 | [] | no_license | import pandas as pd
import numpy as np
import os
import sys
from sklearn.model_selection import train_test_split
from naive_bayes import NaiveBayes
from driver_helper import main
datafile = 'nuclear_senti_dataset.csv'
if __name__ == '__main__':
alpha, reduce, word_freq = main(sys.argv[1:])
dataset = pd.read_... |
JavaScript | UTF-8 | 275 | 3.359375 | 3 | [] | no_license | function TriangleArea(num1, num2, num3){
let semiPerimeter = (num1 + num2 + num3) / 2;
let area = Math.floor(Math.sqrt(semiPerimeter * (semiPerimeter - num1) * (semiPerimeter - num2) * (semiPerimeter - num3)));
return area ;
}
console.log(TriangleArea(3,4,5));
|
Python | UTF-8 | 1,801 | 3.375 | 3 | [
"BSD-2-Clause"
] | permissive | import re
from collections import defaultdict
_ASSERTER_CHILD_NAME_PATTERN = re.compile('^[a-zA-Z0-9_]+$')
class AsserterNode(object):
def __init__(self, parent, on_failure_callback=None):
if parent is not None and not isinstance(parent, AsserterNode):
raise ValueError(
'Inva... |
Swift | UTF-8 | 6,516 | 4.28125 | 4 | [] | no_license | import UIKit
//let type: String = "Rectangle"
//let description: String = "A quadrilateral with four right angles"
//
//var width: Int = 5
//var height: Double = 10.5
//var area = Double(width) * (height)
//
//height += 1
//width += 1
//
//area = Double(width) * (height)
//// Note how you can "interpolate" variables i... |
PHP | UTF-8 | 2,199 | 3.140625 | 3 | [] | no_license | <?php
namespace bibliovox\models;
use Exception;
use Illuminate\Database\Eloquent\Model;
use PDOException;
/**
* Modèle MVC de Recueil
* @method static orderBy(string $nomColone, string $mode)
* @method static where(string $nomColone, string $comparateur, string $valeur)
* @property string nomR le nom du recue... |
PHP | UTF-8 | 3,158 | 2.6875 | 3 | [] | no_license | <?php
/**
* @file
* This file provides drush integration for hosting_vnodectrl.
* It communiciates with the vnodectrl drush backend and provides
* it with information it needs.
*/
/**
* Implementation of hook_drush_command().
*/
function hosting_vnodectrl_drush_command() {
$items = array();
$items['hosting... |
Java | UTF-8 | 2,290 | 3.359375 | 3 | [] | no_license | package xiancheng;
/**
* start方法只是使线程进入就绪状态,要想线程结束,
* 还要等待获取CPU资源来进入运行状态,运行完后结束线程。
* sleep(1000)使线程挂起1000毫秒,1000毫秒过去重新竞争CPU资源。
* 在一个时间点可以处理一个线程,在一个时间段可以处理多个线程(多核除外)。
* @author Administrator
*/
public class TestTongbu {
public static void main(String[] args) {
// final Object someObject = new Object();... |
Python | UTF-8 | 569 | 2.671875 | 3 | [] | no_license | class Solution(object):
def fourSumCount(self, A, B, C, D):
"""
:type A: List[int]
:type B: List[int]
:type C: List[int]
:type D: List[int]
:rtype: int
"""
ans=0
di={}
for i in A:
for j in B:
if i+j ... |
Markdown | UTF-8 | 1,004 | 2.921875 | 3 | [] | no_license | # Applying and Executing a Playbook
Now we will "apply" the newly created playbook to our _StackPulse_ account and trigger its execution. Please return to the "Terminal" tab in your environment.
## Applying your playbook into your StackPulse account
To apply (upload) your playbook into your StackPulse account,... |
C# | UTF-8 | 13,246 | 2.6875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Configuration;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using System.Web.UI.HtmlControls;
namespace TechOnline
{
public partial clas... |
C++ | UTF-8 | 334 | 2.734375 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main(){
int arr[100][100];
int m,n;
cin>>m>>n;
for(int i=0;i<m;i++){
for(int z=0;z<n;z++){
cin>>arr[i][z];
}
}
for(int z=0;z<n;z++){
for(int i=m-1;i>=0;i--){
cout<<arr[i][z]<<" ";
}
cout<... |
Markdown | UTF-8 | 3,201 | 2.953125 | 3 | [] | no_license | # Show and tell - Neural Image Caption Generator
This project is to reimplement the show and tell paper (Vinyals et al., 2015). This application helps visually-impaired people by transforming visual signals into proper language, which involves tasks of both image classification as well as natural language processing. ... |
SQL | UTF-8 | 1,295 | 4.03125 | 4 | [] | no_license | select e.emp_no, e.last_name, e.first_name, e.gender, salaries.salary
from employees as e
join salaries on e.emp_no = salaries.emp_no;
select first_name, last_name, hire_date
from employees
where hire_date > '1985-12-31'
and hire_date < '1987-01-01';
select d.dept_no, d.dept_name, dm.emp_no, e.last_name, e.first_nam... |
Python | UTF-8 | 1,404 | 3.96875 | 4 | [] | no_license | # -*- coding: utf-8 -*-
# @property装饰器负责把一个类方法(动词)变成属性(名词)
# property 属性优先级高于实例化对象属性 即self.score会优先查找property,没有在查找对象的score
class Student(object):
def __init__(self, score):
# self.__score = score # 这种情况,初始化还是可以输入字符串的,
self.score = score # self.score = score 会调用@score.setter def score(self, score... |
Python | UTF-8 | 1,393 | 3.890625 | 4 | [] | no_license | #
guess_word = 'mars'
count = 0
guessword = 'nigeria'
guessword2 = "india"
guessword3 = "andriod"
print('welcome new user')
print()
name = input('what will you want me to call you? ')
print('sound great ' + name)
print("quiz is just for fun, if you get above 2 you passed ")
print()
question = input('which planet is th... |
Java | UTF-8 | 159 | 1.789063 | 2 | [] | no_license | package rasras.feisal.mvp.mvp.view;
/**
* Created by feisal on 1/28/17.
* All rights reserved.
*/
public interface View {
void onError(Throwable e);
} |
Python | UTF-8 | 6,441 | 2.734375 | 3 | [] | no_license | import re
import os
from requests_html import HTML
from file_management import write_dicts_to_file
def open_match(number):
with open('data/players/' + str(number) + '.json') as f:
return f.read()
def scrape_pages(path):
teams = []
statistics = []
players = []
index = 0
for dirpath, ... |
Python | UTF-8 | 716 | 2.640625 | 3 | [] | no_license | # coding=utf-8
"""Classe des code de chaque entités"""
import re
class Code:
def __init__(self,car,s1):
s=string (s1)
self.code=car + s
class CodeFranchise:
n=1
char="F"
def __init__(self):
Code.__init__(self,char,n)
n=n+1
class CodeReservation:
n=1
char="R"
def __init__(self):
Code.__init__(s... |
Java | UTF-8 | 2,220 | 1.804688 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2023 the original author or authors.
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applic... |
Python | UTF-8 | 3,136 | 2.71875 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
'''
Written by Andreas Hellesnes, Norwegian Naval Academy 2019
Behaviour.py
This is the main program behaviour,
it gets data from ROS with swarmData and Subscriber
then calculates new movement from behave class
finally publishes to ROS with talker
Questions: anhellesnes@fhs.mil.no
'''
import ti... |
Java | UTF-8 | 296 | 2.640625 | 3 | [] | no_license | package com.project.ci360;
public class Day {
private String dayID;
private String dayName;
public Day(String id, String dayName){
this.dayID = id;
this.dayName = dayName;
}
public String getDayID() {
return dayID;
}
public String getDayName() {
return dayName;
}
}
|
JavaScript | UTF-8 | 1,343 | 2.984375 | 3 | [
"MIT"
] | permissive | /**
* Created by MW Toolbox on 10/05/2017.
*/
function initMap() {
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 3,
center: {lat: -28.024, lng: 140.887}
});
// Create an array of alphabetical characters used to label the markers.
// Add some markers to the m... |
Rust | UTF-8 | 16,848 | 2.90625 | 3 | [
"MIT"
] | permissive | //!
//! MOS 6502 Instruction set
//!
use std::fmt;
use addr::Address;
use mem::Addressable;
use super::{Mos6502, Operand, IRQ_VECTOR};
use super::{CarryFlag, ZeroFlag, InterruptDisableFlag, DecimalFlag};
use super::{BreakFlag, UnusedAlwaysOnFlag, NegativeFlag, OverflowFlag};
/// Processor instructions
#[derive(Debug,... |
JavaScript | UTF-8 | 2,841 | 3.78125 | 4 | [] | no_license | const baseURL = 'https://ghibliapi.herokuapp.com'; //no key needed
let url; //add the /people to grab the people and films endpoints
//Button
const submitButton = document.querySelector('.submitButton');
const section = document.querySelector('section');
section.style.display = 'none';
//eventListener
submitButton.a... |
Java | UTF-8 | 2,248 | 2.1875 | 2 | [] | no_license | package com.zzwl.ias.mapper;
import com.zzwl.ias.domain.MessageSysRecord;
import org.apache.ibatis.jdbc.SQL;
public class MessageSysRecordSqlProvider {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_sys
*
* @mbg.generated
*/
... |
C++ | UTF-8 | 1,837 | 3.03125 | 3 | [] | no_license | #ifndef LOST_IN_SPACE_
#define LOST_IN_SPACE_
#include "splashkit.h"
#include "player.h"
#include "power_up.h"
#include <vector>
using namespace std;
using std::vector;
struct game_data
{
player_data player;
vector<power_up_data> power_ups;
};
/**
* Creates a new game
*
* @returns The new game data
**/
... |
Markdown | UTF-8 | 8,676 | 2.921875 | 3 | [] | no_license |
### 1、技术选型以及理由
- 微信小程序框架
我们选择了微信小程序开发框架作为用户点餐系统的前端框架。小程序框架提供了自己的视图层描述语言 WXML 和 WXSS,
以及基于 JavaScript 的逻辑层框架,容易上手,并在视图层与逻辑层间提供了数据传输和事件系统,支持响应式、双向数据绑定等特性,
可以让数据与视图非常简单地保持同步:当做数据修改的时候,只需要在逻辑层修改数据,视图层就会做相应的更新,
因而能够很好地支持丰富的用户交互体验支持,可以让开发者方便的聚焦于数据与逻辑上;
框架还管理了整个小程序的页面路由,可以做到页面间的无缝切换,并给以页面完整的生命周期,
开发者需要做的只是将... |
PHP | UTF-8 | 1,517 | 2.640625 | 3 | [] | no_license | <!-- 03 LEARN -->
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="bootstrap.min.css">
<meta charset="UTF-8">
<title>View From Database</title>
</head>
<body>
<div class="container">
<table class="table table-light table-striped border">
<thead class="thead-light text-center"... |
JavaScript | UTF-8 | 845 | 3.90625 | 4 | [
"MIT",
"ISC"
] | permissive | /**
* Eg one
*/
const { resolve } = require("core-js/es6/promise");
const { reject } = require("core-js/fn/promise");
function doAsyncWork(resolve, reject) {
//perform async calls
if (success) {
resolve(data)
} else {
reject("Rejected")
}
}
let myPromise = new Promise(doAsyncWork)
/... |
Java | UTF-8 | 1,850 | 3.921875 | 4 | [] | no_license | package com.etc.structure.stack;
/**
* @Author:zrd
* @Description:
* @Date:2018-8-19 17:44
* 队列 底层也是 数组 特点是 先进先出 , 跟在火车站买票情景相似
*/
public class MyQueue {
private long[] arry;
//有效数据大小
private int elements;
//对头
private int front;
//对尾
private int end ;
public MyQueue(){
... |
PHP | UTF-8 | 2,104 | 3.40625 | 3 | [] | no_license | <?php
// Lege variabelen
$name = "";
$email = "";
$nameError = "";
$emailError = "";
if ($_SERVER["REQUEST_METHOD"] == "POST"){
if(empty($_POST["name"])){
$nameError = "Name is required";
} else {
$name = test_input($_POST["name"]);
}
... |
C# | UTF-8 | 1,933 | 2.859375 | 3 | [] | no_license | using Data_Access_Layer.models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
namespace CASM.Controllers
{
public class PilotApiController : ApiController
{
CasmContext db = new CasmContext();
// GET api/pil... |
Shell | UTF-8 | 269 | 2.796875 | 3 | [
"PHP-3.01"
] | permissive | #!/bin/sh
extdir=`php -r "echo ini_get('extension_dir');" 2> /dev/null`
if [ ! -d "$extdir" ] ; then
mkdir "$extdir"
fi
cp modules/qb.so "$extdir/qb.so"
inidir="/etc/php5/mods-available"
if [ ! -f $inidir/qb.ini ] ; then
cp qb.ini $inidir/qb.ini
fi
php5enmod qb
|
Python | UTF-8 | 436 | 2.84375 | 3 | [] | no_license | def solution(A):
answer = 0
N = len(A)
Chk = [0]*(N+1)
for n in A:
Chk[n] += 1
for i in range(1, N):
if Chk[i] > 1:
answer += Chk[i]-1
Chk[i+1] += Chk[i]-1
elif Chk[i] < 1:
answer += 1-Chk[i]
Chk[i+1] -= 1-Chk[i]
if ans... |
PHP | UTF-8 | 497 | 3.09375 | 3 | [] | no_license | <?php
require_once __DIR__ . '/User.php';
/**
* Employee Class
* Classe Figlia Employee
*/
class Employee extends User {
// Propietà
protected $prezzo;
// Costruttore
public function __construct($_name, $_lastName, $_age, $_prezzo = '85$') {
parent::__construct($_name, $_la... |
Java | UTF-8 | 4,942 | 2.375 | 2 | [] | no_license | package com.firstlab.migration;
import com.firstlab.jpa.Expenditure;
import com.firstlab.jpa.Firm;
import com.firstlab.jpa.Realm;
import com.firstlab.jpa.Staff;
import com.firstlab.jpa.sql.ExpenditureSql;
import com.firstlab.jpa.sql.FirmSql;
import com.firstlab.jpa.sql.RealmSql;
import com.firstlab.jpa.sql.StaffSql;
i... |
Markdown | UTF-8 | 2,240 | 2.890625 | 3 | [
"BSD-3-Clause"
] | permissive | These files represent the initial version of a proposed spec for automating
a datacenter migration. Note that there are no tools built around this yet.
Imagine something like
```
commcare-cloud icds migration 2017-12-01-initial run postgresql
```
which would look at the mapping you'd specified of postgresql machines... |
Markdown | UTF-8 | 6,374 | 3.515625 | 4 | [] | no_license | ### 一.父组件像子组件传数据
#### 传递数据注意:
1.props只用于父组件像子组件传值
2.如果要像非子组件传递数据,必须逐层传递
3兄弟组件传值需借助父组件
#### 1.1传值
1.在父组件进行绑定
```vue
//父组件
//引入的child组件
//使用 v-bind 的缩写语法通常更简单:
<child :msg-val="msg"> //这里必须要用 - 代替驼峰
// HTML 特性是不区分大小写的。所以,当使用的不是字符串模板,camelCased (驼峰式) 命名的 prop 需要转换为相对应的 kebab-case (短横线隔开式) 命名,当你使用的是字符... |
Java | UTF-8 | 1,139 | 2.5 | 2 | [] | no_license | package preschool2me;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class Login_Admin {
public static void main(String[] args) {
String baseUrl="https://staging.daycare2me.com/index.html";... |
Markdown | UTF-8 | 2,296 | 2.734375 | 3 | [] | no_license | ---
layout: layouts/post.njk
title: >
MRS 022: Allison McMillan
date: 2017-09-27 04:00:54
episode_number: 022
duration: 33:02
audio_url: https://media.devchat.tv/my-ruby-story/MRS_022__Allison_McMillan.mp3
podcast: ruby-rogues
tags:
- ruby_rogues
- podcast
---
This week on My Ruby Story, Charles speaks with Alli... |
C++ | UTF-8 | 838 | 2.75 | 3 | [] | no_license | #include<iostream>
#include<algorithm>
#include<map>
#include<vector>
#include<queue>
using namespace std;
int arr[30001];
bool reached[30001] = {0};
int main(){
int n, t;
cin >> n >> t;
map<int, vector<int> > mp;
int m;
for(int i = 0; i < n-1; i++){
cin >> m;
arr[i+1] = i+1+m;
}
int pos = 1;
arr[n] = 1;
... |
C++ | UTF-8 | 957 | 3.109375 | 3 | [] | no_license | /*
Written by: Nicholas Cockcroft
Date: August 12, 2018
Description: The "AI" class is responsible for the AI of the tic tac toe game. Everything needed for the AI to perform properly
will be stored in this class.
*/
#ifndef AI_H
#define AI_H
#include <iostream>
#include <string>
#include <sstream>
#... |
Python | UTF-8 | 2,730 | 2.515625 | 3 | [] | no_license | #********************************************************
#@author: Pam Vinco
#@summary: ScenarioBox handles all Scenario Box functions
#********************************************************
from API.SquishSyntax import SquishSyntax
from API.UserCreatedPacketWindow.ScenarioBoxConst import ScenarioBoxConst
from API.U... |
Markdown | UTF-8 | 814 | 2.515625 | 3 | [] | no_license | # Finanças - Modelo Analítico para Análise de Portfólio
### https://www.datascienceacademy.com.br
Esse é aplicativo RStudio Shiny que constrói eficientes portfólios com base em um modelo de média-variância simples e um modelo Black-Litterman (módulo não concluído).
O aplicativo exibe porcentagens a serem alocadas pa... |
Swift | UTF-8 | 1,186 | 3.109375 | 3 | [] | no_license | //
// main.swift
// SwiftNN
//
// Created by Dan See on 1/6/16.
// Copyright © 2016 Dan See. All rights reserved.
//
// Process.arguments[1] changes the execution directory into the specified directory
// Process.arguments[2] opens the given file for analysis
import Foundation
let featuresVector: [UInt32] = [UInt... |
Python | UTF-8 | 3,082 | 4.0625 | 4 | [] | no_license | """
Procedure:
Create a Trie data structure with insert (for the available words), startswith (to perform dfs) and DFS (to find all words).
Use DFS on every value of the matrix and every complete iteration will have a seen set because we are starting from new at
every cell, also we need to backtrack at each iteration t... |
Markdown | UTF-8 | 2,655 | 2.765625 | 3 | [] | no_license | # About
Comparing 3D structures of homologous RNA molecules yields information about sequence and structural variability. To compare large RNA 3D structures, accurate automatic comparison tools are needed. In this article, we introduce a new algorithm and web server to align large homologous RNA structures nucleotide ... |
C++ | UTF-8 | 264 | 3.234375 | 3 | [] | no_license | #include <iostream>
#include<cmath> //for round function
using namespace std;
float roundoff(float var,unsigned char prec){
float pow_10=pow(10.0f,(float)prec);
return round(var*pow_10)/pow_10;
}
int main() {
cout<<roundoff(234.5618,3);
} |
C# | UTF-8 | 788 | 2.5625 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class simpleController : MonoBehaviour
{
public bool turn;
public Rigidbody2D myRigidBody;
public float moveSpeed;
// Start is called before the first frame update
void Start()
{
}
// Update... |
C++ | UTF-8 | 1,003 | 2.8125 | 3 | [] | no_license | #include <QCoreApplication>
#include <iostream>
#include <hello.h>
using namespace std;
void imprime(int value)
{
std::cout << "Value = " << value << '\n';
}
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
MyObject obj;
// conecta o sinal valueChanged a função imprime
QCoreAp... |
Python | UTF-8 | 1,479 | 3.125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Tue May 22 21:23:39 2018
@author: XIN
"""
class rollingHash(object):
def __init__(self):
self.value = 0
self.base = 26
self.p = 10529
self.size = 0
def append(self, char):
self.value = (self.value*self.base ... |
Java | UTF-8 | 3,314 | 1.664063 | 2 | [] | no_license | // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3)
package com.tencent.mm.modelqrcode;
import a.h;
import android.os.*;
// Referenced classes of package com.tencent.mm.modelqrcode:
// DecodeThread, CameraMan... |
Python | UTF-8 | 166 | 3.828125 | 4 | [] | no_license | def square(x):
return x * x
def main(num):
for num in range(10):
print( "The square of {} is {}".format( num, square(num)))
if __name__ == "__main__":
main()
|
Ruby | UTF-8 | 212 | 2.703125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | class Post
def initialize(title)
@title = title
Author.post_count += 1
end
attr_accessor :author
attr_reader :title
def author_name
self.author ? self.author.name : self.author
end
end
|
C | UTF-8 | 305 | 2.875 | 3 | [] | no_license | /*
** EPITECH PROJECT, 2018
** LibString
** File description:
** putchar, putstr - Output of characters and strings
*/
#include <unistd.h>
size_t my_strlen(char const *str);
int my_putchar(char c)
{
return (write(1, &c, 1));
}
int my_puts(char const *str)
{
return (write(1, str, my_strlen(str)));
}
|
JavaScript | UTF-8 | 2,271 | 3.109375 | 3 | [] | no_license |
//Não funfa mais
function daCrawl () {
lojas = [];
$(".icon").each(function( index ) {
if($(this).attr("height") != "21") {
if(!lojas.includes($(this).attr("title"))) {
lojas.push($(this).attr("title"));
}
}
});
resultado = lojas.join();
console.log(resultado);
}
/... |
C++ | UTF-8 | 841 | 3.015625 | 3 | [] | no_license | #ifndef USER_H
#define USER_H
#include <iostream>
#include <string>
/**
* Implements User functionality and information storage
* You should not need to derive anything from User at this time
*/
class User {
public:
User();
User(std::string name, double balance, int type, unsigned long long hash_password);... |
C# | UTF-8 | 896 | 3.46875 | 3 | [] | no_license | using System;
using System.Linq;
using Xunit;
namespace Kata
{
public class UnitTest1
{
[Theory]
[InlineData("atl","ieer",true)]
[InlineData("atl",null,false)]
public void MatchTest(string firstWord, string secondWord, bool expectedResult)
{
var ... |
Ruby | UTF-8 | 748 | 2.640625 | 3 | [] | no_license | # == Schema Information
#
# Table name: benches
#
# id :bigint not null, primary key
# description :string not null
# lat :float not null
# lng :float not null
# created_at :datetime not null
# updated_at :datetime not null
#
cl... |
Java | UTF-8 | 1,984 | 1.632813 | 2 | [] | no_license | package com.hp.it.perf.ac.app.hpsc.search.service;
import java.util.List;
import org.springframework.jdbc.core.RowCallbackHandler;
import com.hp.it.perf.ac.app.hpsc.search.bean.ConsumerDetailReport;
import com.hp.it.perf.ac.app.hpsc.search.bean.ConsumerHomeInfo;
import com.hp.it.perf.ac.app.hpsc.search.bean.Consumer... |
Java | UTF-8 | 1,177 | 2.890625 | 3 | [] | no_license | package lars.wittenbrink.halligalli.game.cards;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import lars.wittenbrink.halligalli.game.user.User;
public final class Cards {
public Cards(){
}
public static List<Card> createCards() {
List<Card> cards = new Linke... |
Go | UTF-8 | 487 | 2.828125 | 3 | [
"MIT"
] | permissive | package y2021m01
// 每日一题 20210126
//
// 1128. 等价多米诺骨牌对的数量
// Link: https://leetcode-cn.com/problems/number-of-equivalent-domino-pairs/
func numEquivDominoPairs(dominoes [][]int) int {
getIndex := func(arr []int) int {
if arr[0] > arr[1] {
return arr[1]*10 + arr[0]
}
return arr[0]*10 + arr[1]
}
ret := 0
c... |
Ruby | UTF-8 | 1,078 | 3.75 | 4 | [] | no_license | #!/usr/bin/env ruby
# frozen_string_literal: true
def speak(numbers, turns)
tally = Hash[numbers[0..-2].map.with_index { |n, i| [n, i + 1] }]
(numbers.length..(turns - 1)).each do |i|
prev = tally[numbers.last]
prev = prev.nil? ? 0 : i - prev
tally[numbers.last] = i
numbers << prev
end
numb... |
C | UTF-8 | 1,643 | 3.078125 | 3 | [] | no_license | #include <stdio.h>
typedef struct point{
int x;
int y;
} point;
point Point_Default = {0,0};
int contains(point* visited,int size,point item)
{
for(int i =0;i <size;i++)
if(visited[i].x==item.x&&visited[i].y==item.y)return 1;
return 0;
}
int main()
{
FILE* fp = fopen("maze_ai.in","r");
int length;
int width... |
C# | UTF-8 | 1,574 | 4.1875 | 4 | [] | no_license | using System;
using System.Collections.Generic;
namespace ADT_Stack
{
class Program
{
static void Main(string[] args)
{
// stack usage example
Stack<string> stack = new Stack<string>();
stack.Push("1. John Jackson");
stack.Push("2. Nicolas Cage... |
C | UTF-8 | 446 | 4.0625 | 4 | [] | no_license | #include "holberton.h"
/**
* create_array - creates an array of chars, and initializes
* it with a specific char.
* @size: lenght.
* @c: array.
* Return: NULL or array.
*/
char *create_array(unsigned int size, char c)
{
char *pointer;
unsigned int index;
pointer = malloc(size * sizeof(c));
if (size == ... |
Swift | UTF-8 | 4,584 | 2.796875 | 3 | [] | no_license | //
// FirestoreService.swift
// Messenger
//
// Created by Леонид on 19.08.2020.
// Copyright © 2020 LSDevStudy. All rights reserved.
//
import Firebase
import FirebaseFirestore
class FirestoreService {
static let shared = FirestoreService()
let db = Firestore.firestore()
private var usersRe... |
Java | UTF-8 | 5,484 | 2.203125 | 2 | [] | no_license | package com.example.yash.weatherapi;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.AsyncTask;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Arra... |
PHP | UTF-8 | 10,555 | 2.703125 | 3 | [] | no_license | <?php
// 'edit.php'
require_once "pdo.php";
require_once "util.php";
session_start();
// If the user is not logged-in
if ( ! isset($_SESSION['user_id'])) {
die('ACCESS DENIED');
return;
}
// If the user requested cancel, go back to index.php
if ( isset($_POST['cancel']) ) {
header('Location: index.php... |
C# | UTF-8 | 1,309 | 3.078125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Ex03.GarageLogic
{
public static class VehicleCreator
{
public static string[] s_VehicleTypesMenu = {"Electric car", "Fuel car", "Electric motorcycle", "Fuel motorcycle", "Truc... |
Java | UTF-8 | 191 | 2.390625 | 2 | [] | no_license | package operational.interpreter;
public class KeyExpression implements Expression<String>
{
@Override
public String interpret(Context context) {
return context.nextToken().trim();
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.