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 | 3,534 | 2.546875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;... |
Shell | UTF-8 | 275 | 3.140625 | 3 | [
"MIT"
] | permissive | #!/bin/sh
name=${NAME:-$UNOPROJ}
echo travis_fold:start:android
uno build -tAndroid -DGRADLE ${UNOPROJ}.unoproj -v
exitcode=$?
echo travis_fold:end:android
if [ $exitcode -ne 0 ]; then
echo "uno android $name - FAIL"
else
echo "uno android $name - PASS"
fi
exit $exitcode
|
Python | UTF-8 | 477 | 3.203125 | 3 | [] | no_license | # Leetcode 693:
#
# https://leetcode.com/problems/binary-number-with-alternating-bits/
# Runtime: 36 ms
# Memory Usage: N/A
class Solution:
def hasAlternatingBits(self, n):
"""
:type n: int
:rtype: bool
"""
if n == 1:
return True
pre = n & 1
whil... |
JavaScript | UTF-8 | 1,010 | 2.53125 | 3 | [
"MIT"
] | permissive | import axios from "axios";
import { without } from "lodash"
export default {
namespaced: true,
state : {
likes : []
},
getters : {
likes (state) {
return state.likes
}
},
mutations : {
PUSH_LIKES ( state, data ) {
state.likes.push(...da... |
JavaScript | UTF-8 | 1,455 | 2.828125 | 3 | [
"MIT"
] | permissive | $('document').ready( function() {
// highlight checked sources
selectImages();
// toggle check on checkbox when image is clicked
checkUncheck();
$('#news-sources-container').off('click'); // without this, click event will fire twice
$('#news-sources-container').on('click', '.form-image', function(){
... |
C++ | UTF-8 | 2,367 | 3.546875 | 4 | [] | no_license | //
// Created by Duncan Marget on 6/9/21.
//
#include "Bureaucrat.hpp"
Bureaucrat::Bureaucrat()
{}
Bureaucrat::Bureaucrat(std::string const &name, int grade)
:_name(name), _grade(grade)
{
if (_grade < 1)
throw Bureaucrat::GradeTooHighException();
else if (_grade > 150)
throw Bureaucrat::GradeTooLowException();... |
Markdown | UTF-8 | 1,284 | 2.703125 | 3 | [] | no_license | # Achievers
Intro_to_SE Project
| Role | Name |NetID | GitHub Username |
|:-----------:|:-----------------:|:-----:|:-------------------:|
|Team Leader |Felicity Harvard |fah78 |FelicityHarvard |
|Team Member1 |Caleb Mills |ctm364 |CTMills |
|Team Member2 |Eddie Caveness ... |
PHP | UTF-8 | 844 | 2.578125 | 3 | [] | no_license | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateDailyTasksTable extends Migration
{
public $connection='masterDB';
public function up()
{
if (!Schema::hasTable('dailytasks'))
{
Sch... |
PHP | UTF-8 | 3,377 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use App\Model\GoodsModel;
use DB;
use App\Model\CartModel;
use Illuminate\Http\Request;
use Session;
class CartController extends Controller
{
//加入购物车
public function cartadd(){
$g_id = request()->g_id;
$goodsWhere = [
'g_id' => $g_id,
];
$goodsInfo = DB::table('go... |
C | UTF-8 | 574 | 3.375 | 3 | [] | no_license | #include "bit_operations.h"
#include <stdio.h>
#include <stdlib.h>
//---------------------------------------------
int get_bit(int A, int x){
//Renvoie le xième bit de A
return (A >> x) & 1;
}
//---------------------------------------------
int set_bit(int A, int x){
// renvoie A où son xième bit a été mis à 1
int ... |
Ruby | UTF-8 | 1,845 | 3.40625 | 3 | [] | no_license | require_relative './dragon'
require_relative './blue_dragon'
require_relative './red_dragon'
describe 'Dragon' do
it 'should create a dragon' do
name = 'Dolly'
owner_name = 'Babi'
pet = Dragon.new(name,owner_name)
expect(pet.name).to eq name
expect(pet.owner_name).to eq owner_name
end
it 'sh... |
Java | UTF-8 | 804 | 2.078125 | 2 | [] | no_license | package com.tiny.model;
import java.util.Date;
public class Like {
private String providerUserId;
private Integer documentId;
// true : like
// false : dislike
private Boolean isLike;
private Date regDate;
public String getProviderUserId() {
return providerUserId;
}
public void setProviderUser... |
C++ | UTF-8 | 3,725 | 3.03125 | 3 | [
"MIT",
"CC-BY-4.0"
] | permissive | // Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma
// de Barcelona (UAB).
//
// This work is licensed under the terms of the MIT license.
// For a copy, see <https://opensource.org/licenses/MIT>.
#pragma once
#include "carla/Debug.h"
#include <array>
namespace carla {
namespace geom {
... |
Swift | UTF-8 | 1,783 | 2.90625 | 3 | [
"MIT"
] | permissive | //
// CollectionViewAdapter.swift
// GitHub Client
//
// Created by Alexander Vinogradov on 26.08.2021.
//
import UIKit
protocol CollectionViewAdapter: UICollectionViewDataSource {
func register(_ collectionView: UICollectionView)
func update(_ items: [Any])
}
final class CollectionViewAdapterImpl: NSObje... |
Python | UTF-8 | 4,934 | 3.28125 | 3 | [] | no_license |
import random
import sys
def posValida(i,j):
if i >= 0 and j >= 0 and i < num and j < num:
if tableroVisible[i][j] == 0 or tableroVisible[i][j] == 1 or tableroVisible[i][j] == 2:
return True
else:
return False
... |
Markdown | UTF-8 | 1,347 | 2.609375 | 3 | [] | no_license | ---
layout: post
title: 提出公務員加薪2.5% 楊何蓓恩強調非向商界傾斜
date: 2022-07-06 09:22:25.000000000 +08:00
link: https://news.rthk.hk/rthk/ch/component/k2/1656391-20220706.htm
categories: rthk
---
公務員事務局局長楊何蓓茵表示,提出各級公務員劃一加薪2.5%,不是容易的決定,認為已平衡各項因素,形容今年是特殊的一年,作出審慎的決定會較安全。
楊何蓓恩在本台節目《千禧年代》表示,明白公務員在過去一年工作艱難,但也要考慮本港經濟及政府財政狀況,失業率高,今年赤字預算... |
C++ | UTF-8 | 773 | 2.59375 | 3 | [] | no_license | // Author: rl3107
// computes sine (sin(x))
// Rename this file to xllsin.cpp and implement XLL.SIN which calls sin
// Add documentation and a test function that runs in debug mode.
#include "xllfloat.h"
#ifndef CATEGORY
#define CATEGORY _T("Float")
#endif
using namespace xll;
static AddIn xai_sin(
Function(XLL_DOU... |
Java | UTF-8 | 5,019 | 1.96875 | 2 | [] | no_license | package com.huawei.mms.util;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.Configuration;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import android.view.ScaleGestureDetector.OnScaleGestureListener;
import android.view.View;
import and... |
Python | UTF-8 | 150 | 2.53125 | 3 | [
"BSD-3-Clause"
] | permissive | # Define you tests here
"""
import unittest
class MlaskExampleTest(unittest.TestCase):
def test_mlask_sum(self):
self.assertEqual(1 + 1, 2)
"""
|
Markdown | UTF-8 | 8,811 | 2.75 | 3 | [] | no_license | # parse-server-example
Example project using the [parse-server](https://github.com/ParsePlatform/parse-server) module on Express.
Read the full Parse Server guide here: https://github.com/ParsePlatform/parse-server/wiki/Parse-Server-Guide
### For Local Development
* Make sure you have at least Node 4.3. `node --ver... |
Markdown | UTF-8 | 4,145 | 2.609375 | 3 | [] | no_license | ---
title: spring restTemplate调用提供者方法
date: 2019-12-17 9:00:00
category: Learn
tags:
- springcloud
- restTemplate
---
> RestTemplate 简化了发起HTTP请求以及处理响应的过程,并且支持REST
<!-- more -->
只需要引入spring-web包即可
```xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</ar... |
Markdown | UTF-8 | 27,036 | 3.1875 | 3 | [
"CC-BY-SA-4.0",
"MIT"
] | permissive | ---
title: Using Laravel resource controller with AngularJS ngResource
kind: article
created_at: '2014-12-02 00:00:00 +0800'
slug: using-laravel-resource-controller-with-angularjs-ngresource
abstract: 'An example of a RESTful API-based web app using Laravel 4.2
resource controller and AngularJS 1.4 NgResource'
---
Lar... |
Java | UTF-8 | 2,260 | 2.28125 | 2 | [
"MIT"
] | permissive | package top.viewv.controller;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.IOException;
import java.net.URL;
import java.util.Objects;
import java.util.ResourceBund... |
Java | UTF-8 | 5,183 | 2.109375 | 2 | [
"Apache-2.0"
] | permissive | package com.example.crops;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import andro... |
Markdown | UTF-8 | 4,781 | 3.390625 | 3 | [
"MIT"
] | permissive | # Wrangle and Analyze Data
# Introduction
This project focused on wrangling data from the WeRateDogs Twitter account using Python, documented in a Jupyter Notebook (wrangle_act.ipynb). This Twitter account rates dogs with humorous commentary. The rating denominator is usually 10, however, the numerators are usually g... |
Markdown | UTF-8 | 1,280 | 3.28125 | 3 | [] | no_license | # Full-Stack-Software-Journey
A repository to hold all the relevant files for my journey to become a Software Engineer.
This repository will delve into HTML, CSS, JavaScript (ES6), and the MEAN stack.
# Phase 1: Foundation
The first phase of the boot camp, Foundation, equips you with the fundamental concepts of web... |
Python | UTF-8 | 133 | 3.796875 | 4 | [] | no_license | x=input("请输入一个5位数字:")
if x==x[::-1]:
print("这是一个回文数")
else:
print("这不是一个回文数")
|
PHP | UTF-8 | 450 | 3.5625 | 4 | [] | no_license | <?php
class car {
private $matricule;
public function __construct() {;
}
//GETTERS SETTERS
public function getMatricule() {
return $this->matricule;
}
public function setMatricule($value) {
$this->matricule = $value;
}
//For Display
public function render() {
echo $this->getMatricu... |
Markdown | UTF-8 | 1,917 | 3.484375 | 3 | [] | no_license | # 选择结构
- if
```
(1)------------
if(条件) {
//代码块
}
注: 只有一条语句时,建议不省略{}
(2)------------
&& || !
(3)------------
if(条件){
//代码块1
}else{
//代码块2
}
(4)------------
多重if选择结构
:
if(条件){
//代码块1
}else if(条件){
//代码块2
}else{
/... |
Java | UTF-8 | 464 | 2.75 | 3 | [] | no_license | package Uebung1_Komplexitaet;
public class Uebung142 {
public static void main(String[] args) {
int n = 1000000000;
int i;
int j;
int sum = 0;
long start = System.currentTimeMillis();
for (i=0; i<n; i++) {
for (j=0; j<n; j++) {
sum++;
... |
Python | UTF-8 | 947 | 3.921875 | 4 | [] | no_license | #!/usr/bin/python
GRID_SIZE = 21
# Ludicrously slow method!
def traverse_grid(path, x, y, count):
path.append((x, y))
# End of the grid!
if x == GRID_SIZE - 1 and \
y == GRID_SIZE - 1:
#print path
return count + 1
else:
# You can move right. Do it!
if (x + 1) <= ... |
Java | UTF-8 | 2,865 | 2.34375 | 2 | [
"BSD-2-Clause"
] | permissive | package at.o2xfs.xfs.api;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import at.o2xfs.memory.databind.annotation.MemoryPropertyOrder;
import at.o2xfs.memory.databind.annotation.Pointer;
@Memor... |
Markdown | UTF-8 | 832 | 2.59375 | 3 | [] | no_license | ---
title: "Anacardiaceae Spondias dulcis"
family: "Anacardiaceae"
species: "Spondias dulcis"
genus: "Spondias"
sp1: "dulcis"
author1: "Parkinson"
rank1: ""
sp2: ""
author2: ""
vernacular: "Kedondong, Great Hog Plum, Golden Apple, Otaheite Apple, Yellow Plum, Jew Plum, Ambrarella"
ecology: "Dry or secondary vegetation ... |
JavaScript | GB18030 | 4,601 | 2.5625 | 3 | [] | no_license | /**
* author: zhongting.zy
* ʹDracularʾǿjs
*/
window.onload = function() {
//趨ó
var width = $(document).width(); //ȥĿ
var height = $(document).height();
document.getElementById('canvas').style.width = width + 'px';
document.getElementById('canvas').style.height = height + 'px';
//̶ɫ,չ
var colorArray = ne... |
Shell | UTF-8 | 416 | 2.59375 | 3 | [] | no_license | #!/bin/bash
touch /tmp/.rankmirrors
rankmirrors -n 5 /etc/pacman.d/mirrorlist > /tmp/.ranked-mirrorlist 2>&1
echo "# Fastest mirrors selected during installation" > /tmp/.tmp-mirrorlist 2>&1
tail -n 5 /tmp/.ranked-mirrorlist >> /tmp/.tmp-mirrorlist 2>&1
cat /tmp/.tmp-mirrorlist /etc/pacman.d/mirror... |
C++ | UTF-8 | 6,872 | 2.796875 | 3 | [
"Apache-2.0"
] | permissive | /*
* Copyright (C) 2012 BMW Car IT GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... |
Java | UTF-8 | 514 | 2.09375 | 2 | [] | no_license | package starter.trades;
import net.serenitybdd.rest.SerenityRest;
import net.thucydides.core.annotations.Step;
import starter.WebServiceEndPoints;
public class RecordNewTrade {
@Step("Record a new trade")
public void withDetails(String trade) {
SerenityRest.given()
.contentType("appli... |
C++ | UTF-8 | 2,759 | 3.0625 | 3 | [] | no_license | /* CHANGELOG
* Written by Josh Grooms on 20160922
*/
#pragma once
#include "TypeDefinitions.h"
#include "UtilitiesAPI.h"
namespace Cyclone
{
namespace Utilities
{
template<typename T> class ICollectionIterator;
template<typename T>
class ICollection
{
public:
... |
Python | UTF-8 | 457 | 3.875 | 4 | [] | no_license | # file handling
# opening file for appending
f = open('demofile.txt','a')
# writing in the file
f.write('what is your name?')
#closing the file
f.close()
# writing in a file
fp2 = open('demofile3.txt','w')
fp2.write('Now the file has more content!')
# open and read the file after the appending
fp2.write('what up'... |
Java | UTF-8 | 421 | 2.625 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.samjin.JavaFeature;
/**
*
* @author Sam
*/
public class Son2 extends Father {
Son2(int x) {
super(x);
... |
Java | UTF-8 | 1,567 | 2.25 | 2 | [
"Apache-2.0"
] | permissive | package com.dyhpoon.fodex.fodexView;
import android.content.Context;
import android.database.Cursor;
import android.support.v4.widget.CursorAdapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.dyhpoon.fodex.R;
import com.dyhpo... |
Python | UTF-8 | 218 | 2.859375 | 3 | [] | no_license |
#! /usr/bin/env python
def public_government(str_arg):
point(str_arg)
print('other_thing_and_year')
def point(str_arg):
print(str_arg)
if __name__ == '__main__':
public_government('woman_or_place')
|
C++ | UTF-8 | 747 | 2.828125 | 3 | [] | no_license | #include<stdio.h>
#include<conio.h>
#include<alloc.h>
int main()
{
clrscr();
int *pp,n=10,i,j,*qq;
pp=(int *)malloc(n*sizeof(int));
qq=(int *)calloc(10,sizeof(int));
n=0;
for(i=0;i<10;i++)
{
scanf("%d",(pp+i));
}
for(i=0;i<10;i++)
{
scanf("%d",(qq+i));
}
printf("this is loops");
for(i=0;i<9;i++)
{
... |
Python | UTF-8 | 390 | 3.140625 | 3 | [] | no_license | import math
import numpy as np
import matplotlib.patches as patches
class Marker(object):
def __init__(self, x, y):
self.x = x
self.y = y
def intensity_at(self, x, y):
return np.array([abs(self.x - x), abs(self.y - y)])
def draw(self, ax):
circle = patches.Circle((self.... |
Java | UTF-8 | 16,315 | 1.703125 | 2 | [] | no_license | package com.lfk.drawapictiure.Activity;
import android.app.ProgressDialog;
import android.content.ContentValues;
import android.content.Intent;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Message;
import andro... |
Python | UTF-8 | 2,534 | 3.03125 | 3 | [] | no_license | import numpy as np
import pandas as pd
def f(x, y):
# optimization function
return((1 - x)**2) + (100 * ((y - x**2)**2))
def c(x, y):#Inequality Contraints
c1 = max(0, ((x * x) + (x - y) + 1.5))
c2 = max(0, (10 - (x * y)))
return (c1,c2)
def constraint(x, y):#Fitness function with constraints... |
Java | UTF-8 | 1,372 | 3.765625 | 4 | [] | no_license | public class RGB {
public short red;
public short green;
public short blue;
public RGB() {
red = 0;
green = 0;
blue = 0;
}
public RGB(short red, short green, short blue) {
this.red = red;
this.green = green;
this.blue = blue;
}
public short getColor(String color) {
if (color.equals("red")) {
... |
PHP | UTF-8 | 894 | 2.515625 | 3 | [] | no_license | <?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
/**
* Class FinancialDetail.
*
* @package namespace App\Models;
*/
class FinancialDetail extends Model
{
use SoftDeletes;
protected $table = 'financial_detail';
/**
* The attributes t... |
Python | UTF-8 | 174 | 2.75 | 3 | [] | no_license | # Create loglog plot of histogram data in xy style - python matplotlib
x = sorted( degree_frequencies.keys( ) )
y = [ degree_frequencies[ k ] for k in x ]
plt.loglog( x, y )
|
Python | UTF-8 | 115 | 3.25 | 3 | [] | no_license | def increment(i):
i += 1 # switch
v = i # switch
return v
a = 0
b = increment(a)
print(a)
print(b)
|
PHP | UTF-8 | 991 | 2.546875 | 3 | [] | no_license | <?php
$servername = "localhost";
$username = "monitor";
$password = "1234";
$dbname = "srDB";
//create DB connection
$conn = new mysqli($servername,$username,$password,$dbname);
//check DB connection
if($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
//Fetch data to DB
$sql = "SELECT ... |
Java | UTF-8 | 2,562 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | package top.caoxuan.tortoiseserver.websocket;
import com.alibaba.fastjson.JSON;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.socket.CloseStatus;
import org.springframework.web.socket.TextMessage;
import org.springframework.web.socket.WebSocketSession;
import org.springframewo... |
JavaScript | UTF-8 | 2,138 | 3.515625 | 4 | [] | no_license | function MilitaryResource(type, maxHealth, maxDistance) {
this.type = type;
this.health = health = maxHealth;
this.maxHealth = maxHealth;
this.distance = distance = maxDistance;
this.maxDistance = maxDistance;
}
MilitaryResource.prototype.isReadyToMove = function() {
return this.di... |
Swift | UTF-8 | 3,691 | 2.71875 | 3 | [] | no_license | //
// L5ViewController.swift
// LearnOpenGL
//
// Created by xurunkang on 2019/7/10.
//
import Foundation
import GLKit
class L5ViewController: BaseViewController {
// 注意: effect 的初始化需要在设置 EAGLContext.setCurrent 后
private lazy var effect: L5BaseEffect = {
let effect = L5BaseEffect("l5vertex.vsh",... |
C++ | UTF-8 | 2,699 | 2.65625 | 3 | [] | no_license | #include <iostream>
#include <csignal>
#include "LOG.h"
#include "Device.h"
#include "ProcessImage.h"
#include <getopt.h>
Device device;
ProcessImage processImage;
//static const char short_options[] = "c:d:f:F:hmo:rs:uz";
static const char short_options[] = "d:g:s:h";
static const struct option
long_option... |
Java | UTF-8 | 1,213 | 2.046875 | 2 | [] | no_license | package com.hsbc.group.iip.x.leavedao.dao.impl;
import java.util.HashMap;
import java.util.Map;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import com.hsbc.group.iip.x.common.model.PersonalAvailableLeave;
import com.hsbc.group.iip.x.leavedao.dao.LeaveDao;
import com.hs... |
TypeScript | UTF-8 | 565 | 2.953125 | 3 | [] | no_license | import { LikesAction, SET_LIKES, SET_DISLIKES } from 'store/actions/like';
export type Preference = {
likes: number[];
dislikes: number[];
};
const initialState: Preference = {
likes: [],
dislikes: [],
};
const likesReducer = (state = initialState, action: LikesAction) => {
switch (action.type) {
case S... |
C++ | UTF-8 | 1,686 | 3.53125 | 4 | [] | no_license | #ifndef MEMORYPOOL_H
#define MEMORYPOOL_H
#include <sys/types.h>
#include <string>
#define POOLSIZE 32
using namespace std;
//Linked List to store next memory location
struct heapList {
heapList* next;
};
// A Custom memory manager, that improves performance by working on preallocated chunks of memory
// rather ... |
C | UTF-8 | 1,701 | 3 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include "pokemon.h"
#include "gotoxy.h"
#include "menu.h"
void inic_HPBAR(char* ps, int dim);
void inicMascara(char* mascara, int dim);
int calcularPorcHP(int psActual, int psTotal, int dimArreglo);
void printHPBAR(char* HPBAR, int posFinal);
void printHPMascara(char* mascara,... |
C# | UTF-8 | 490 | 3.109375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
namespace LibraryApp
{
public class User : IEquatable<User>
{
public string Name { get;private set; }
public User (string name)
{
if (!string.IsNullOrWhiteSpace(name))
Name = name;
}
public bo... |
JavaScript | UTF-8 | 3,016 | 2.546875 | 3 | [] | no_license | const {Todo, User} = require('../models');
class TodoController {
static createTodo(req, res, next) {
Todo.create({
title: req.body.title,
description: req.body.description,
status: false,
due_date: req.body.due_date,
UserId: req.decoded.id
... |
PHP | UTF-8 | 747 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
namespace Vormkracht10\Seo\Traits;
use Illuminate\Http\Client\Response;
use Readability\Readability;
use Symfony\Component\DomCrawler\Crawler;
trait Actions
{
private function getTextContent(Response $response, Crawler $crawler): string
{
$body = $response->body();
if ($this->useJavasc... |
Java | UTF-8 | 371 | 2.671875 | 3 | [] | no_license | import java.awt.*;
import java.applet.*;
public class num extends Applet
{
public void paint(Graphics g)
{
int v1=4,v2=4,sum;
sum = v1+v2;
String s = "summation:" +String.valueOf(sum);
g.drawString(s,100,100);
}
}
/*
<html>
<body>
<applet width="400" height="400" codebase="." code="n... |
Markdown | UTF-8 | 855 | 3.28125 | 3 | [] | no_license | ## 1.1 Uniform convergence and continuity, integration and differentiation
One of the main questions in relation to convergence of sequences and series is whether important properties of the functions $f_k$, like continuity, integrability and differentiability, are preserved in the limit process. Also, what is the rel... |
Python | UTF-8 | 4,438 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | # -*- coding: utf-8 -*-
import csv
import json
import math
def loadCsv(filename):
lines = csv.reader(open(filename, "r"))
dataset = list(lines)
for i in range(len(dataset)):
dataset [i] = [str(x) for x in dataset[i]]
return dataset
def categorize_data(data):
categorized = {}
for i in ... |
Java | UTF-8 | 328 | 1.835938 | 2 | [] | no_license | package com.mone.server.casemanagergenerator.config;
/**
* @Description
* 生成策略
* SIMPLE 生成最基本的代码
* SINGLE 生成单表操作代码
* ALL 生成所有的代码
* @Classname GeneratorStrategy
* @auther motao
* @create 2020-06-30 16:19
*/
public enum GeneratorStrategy {
SIMPLE, SINGLE, ALL
}
|
Java | UTF-8 | 871 | 3.078125 | 3 | [
"Apache-2.0"
] | permissive | package util;
import java.util.List;
public final class Node implements util.Tree {
public final int label;
public final List<Tree> subtrees;
@Override
public int hashCode() {
return java.util.Objects.hash(label, subtrees);
}
@Override
public boolean equals(Obje... |
Java | UTF-8 | 504 | 1.835938 | 2 | [] | no_license | package net.orcades.gwt.spring.demo.shared.rpc;
import net.customware.gwt.dispatch.shared.Action;
public class ZozoAction implements Action<ZozoResult> {
/**
*
*/
private static final long serialVersionUID = 1L;
private String message;
@SuppressWarnings("unused")
private ZozoAction() {
}
publi... |
Java | UTF-8 | 832 | 3.109375 | 3 | [] | no_license |
package sort;
public class Sort {
public static void main(String[] args) {
int arr[]={7,19,15,1,2,6,1,15,15,1};
int i=0;
int sum=0;
int repeat=0;
int num=0;
int size=10;
int indexes=9;
while (i<=indexes){
num=arr[i];
... |
Java | UTF-8 | 2,397 | 2.328125 | 2 | [] | no_license | package app.recruiter.intellingent.intellicruiter;
import android.app.Activity;
import android.support.annotation.NonNull;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
... |
C# | UTF-8 | 1,207 | 2.890625 | 3 | [
"MIT"
] | permissive | using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace Nuke.GitHub
{
public static class ChangeLogExtensions
{
public static string GetCompleteChangeLog(string changeLogFile)
{
var fileContent = File.ReadAllText(changeLogFile);
... |
Python | UTF-8 | 2,250 | 2.5625 | 3 | [
"MIT"
] | permissive | # Import Configuration
from config import config
output_dir = config["OUTPUT"]["DIRECTORY"]
# Import External
import re
import cairo
import matplotlib
from graph_tool.all import *
from os import listdir
from os.path import isfile, join
from halo import Halo
# MAIN
#Print all vertices
def display_vertices(vertices,... |
JavaScript | UTF-8 | 537 | 3.734375 | 4 | [] | no_license | function solve(crews) {
crews.map(Number);
let dailyCostArr = [];
while (!crews.every(x => x === 30)) {
let dailyCost = 0;
for (let i = 0; i < crews.length; i++) {
if (crews[i] !== 30) {
crews[i]++;
dailyCost += 195;
}
}
... |
C# | UTF-8 | 998 | 3.609375 | 4 | [] | no_license | using System;
using System.Reflection.Metadata;
namespace TicTacToeGame
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Welcome to Tic Tac Toe Game");
TicTacToe tic = new TicTacToe();
// To create a new board
char ... |
Shell | UTF-8 | 407 | 2.9375 | 3 | [] | no_license | mkdir -p data/align/$1
for file in `ls $1`
do
out_file=`echo $file | sed 's/_/-/g' | sed 's/.html//'`
echo $out_file
python python/scrapper_soupparser.py $1/$file | grep '^\[O\]' | sed -e 's/^\[O\][^A-Za-z]*//' > data/align/$1/${out_file}_original.snt
python python/scrapper_soupparser.py $1/$file | gre... |
JavaScript | UTF-8 | 470 | 2.53125 | 3 | [
"MIT"
] | permissive | import {ADD_GENERATED_CALENDAR, CLEAR_GENERATED_CALENDAR, DELETE_GENERATED_CALENDAR} from '../constants';
export default function GeneratedCalendarsReducer(state = [], action) {
const { calendar, index } = action;
switch (action.type) {
case ADD_GENERATED_CALENDAR:
return [...state, calendar];
case DELETE_... |
TypeScript | UTF-8 | 715 | 2.875 | 3 | [] | no_license | import { Constructor } from './constructor';
import { HasElementRef } from './types';
/** Possible size palette values. */
export declare type ElementSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'body' | undefined;
/** @docs-private */
export interface CanSize {
/** Theme size palette for the component... |
Python | UTF-8 | 22,481 | 3.484375 | 3 | [
"MIT"
] | permissive | import re
from graphFromText.fxnFromText.fxnGraph import getSymbolGraphMulti
##################### Will map x + y = z + u as {'x':['z','u','y']} ##########################
def graphByEquals2(Text):
#"tokenize" or parse according to newline character, \n
listOfEquations = re.split(r'\n',Text)
# strip whit... |
Python | UTF-8 | 563 | 3.296875 | 3 | [] | no_license | import numpy as np
import matplotlib.pyplot as plt
def AND(x1, x2):
x = np.array([x1, x2])
w = np.array([0.5, 0.5])
b = -0.7
y = np.sum(x * w) + b
if y <= 0:
return 0
else:
return 1
def step_function(x):
return np.array(x > 0, dtype=np.int)
def sigmoid(x):
return 1 ... |
Java | UTF-8 | 2,305 | 2.546875 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] | permissive | package jester;
import java.io.*;
import java.util.Properties;
public class RealConfiguration implements Configuration {
public static final String DEFAULT_CONFIGURATION_FILENAME = "jester.cfg";
private Logger myLogger = new RealLogger();
private Properties myProperties;
public RealConfiguration(Str... |
JavaScript | UTF-8 | 1,009 | 2.796875 | 3 | [] | no_license | const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://www.jd.com/');
const hrefArr = await page.evaluate(() => {
let arr = [];
const aNodes = document.querySelectorAll('.cate_menu_lk... |
SQL | UTF-8 | 1,650 | 3.03125 | 3 | [] | no_license | -- MySQL Script generated by MySQL Workbench
-- Thu Jul 26 13:43:27 2018
-- 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='TR... |
JavaScript | UTF-8 | 3,262 | 3.203125 | 3 | [] | no_license | const holdL = document.querySelector("#countForL");
const holdS = document.querySelector("#countForS");
const output = document.querySelector("#output");
const input = document.querySelector("#gameInput");
const startButton = document.querySelector("#startBtn");
const pressL = document.querySelector("#pressForL");... |
Java | UTF-8 | 697 | 1.601563 | 2 | [] | no_license | package com.miui.yellowpage.ui;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import com.miui.yellowpage.base.utils.Log;
/* compiled from: BaseWebFragment */
class cV extends BroadcastReceiver {
final /* synthetic */ bw this$0;
cV(bw bwVar) {
... |
Java | UTF-8 | 4,530 | 2.28125 | 2 | [] | no_license | package pl.gihon.fdd.poi.localisator.google;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.List;
import java.util.stream.Collectors;
import org.apache.http.client.ClientProtocolExce... |
C# | UTF-8 | 1,620 | 2.625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using Moq;
using WordFrequencyCounter.Core.ChunkProcessing;
using Xunit;
namespace WordFrequencyCounter.Tests
{
public class ChunkWordFrequencyCounterTests
{
[Theory]
[InlineData("../../../../../sam... |
Python | UTF-8 | 379 | 3.390625 | 3 | [] | no_license | import random
M = input()
op = ['+','-','*','/']
#s = random.random(op)
s = input(random.choice(op))
N = input()
if s == '+':
A = eval('M + N')
print("{:.2f}".format(A))
elif s == '-':
B = eval('M - N')
print("{:.2f}".format(B))
elif s == '*':
C = eval('M * N')
print("{:.2f}".format(C))
elif s =... |
JavaScript | UTF-8 | 1,709 | 2.625 | 3 | [] | no_license | /**
* Created by miracle on 16-11-14.
*/
(function () {
var url = "http://127.0.0.1:3000/list";
window.onload=function () {
$.post(url,{},function (data, status) {
for(var i=0;i<data.length;i++){
addDiv();
var imgs = document.getElementsByClassName('imgs')[0... |
Markdown | UTF-8 | 7,549 | 3.28125 | 3 | [] | no_license | # Configuration
## Overview
Configuration provides you ability to customize your app with set of attributes. These attributes contain information required by application and used across program code.
The whole structure of config data is defined in a base configuration file. In addition, your app can be configured by... |
Java | UTF-8 | 686 | 3.984375 | 4 | [] | no_license |
public class DisplayPatterns {
public static void main(String args []) {
patternA(6);
patternB(6);
}
private static void patternA(int length) {
System.out.println("\n-----------Pattern A---------------");
for (int r = 0; r < length + 1; r++) {
for (int c = 1; c <= r; c++) {
... |
JavaScript | UTF-8 | 443 | 2.71875 | 3 | [] | no_license | console.log('Lista de reproducción')
alert('Creación de playlist de música')
const nombrePlaylist = prompt('Ingresa el nombre de la playlist');
const cancionUno = prompt('Ingresa una canción');
const cancionDos = prompt('Ingresa una canción');
const cancionTres = prompt('Ingresa una canción');
alert(`Se ha creado l... |
Java | UTF-8 | 759 | 2.453125 | 2 | [] | no_license | package com.company.Server;
public enum Command {
DELETE,
SHOW,
CHANGE_LOGIN,
QUIT,
MESSAGE,
TRANSFER_FILE,
HELP,
SHOW_ALL_NAME,
SHOW_ALL_DATE;
public static Command fromString(String str){
switch (str){
case "SHOW": return Command.SHOW;
case "DE... |
Java | UTF-8 | 1,989 | 2.53125 | 3 | [] | no_license | package bonus.commands;
import bonus.catalog.Catalog;
import bonus.items.ItemsList;
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;
import freemarker.template.TemplateExceptionHandler;
import java.awt.*;
import java.io.BufferedWriter;
import... |
TypeScript | UTF-8 | 1,017 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | import { Component } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
interface ComboboxItem {
displayedValue: string;
value: string;
}
@Component({
selector: 'fd-combobox-forms-example',
templateUrl: 'combobox-forms-example.component.html',
styleUrls: ['combobox-form... |
Markdown | UTF-8 | 25,351 | 3.140625 | 3 | [
"MIT"
] | permissive | ---
title: 途游面试
tags:
- 面试
categories:
- 💻 工作
- 面试
date: 2020-05-26 12:27:56
permalink: /pages/b4654d/
---
1. python 生成器,迭代器,装饰器
[Python 面试 | 别院牧志](/python/interview/#迭代器和生成器)
2. strip/lstrip/rstrip 用法
strip: 用来去除头尾字符、空白符(包括\n、\r、\t、' ',即:换行、回车、制表符、空格)
lstrip:用来去除开头字符、空白符(包括\n、\r、\t、' ',即:换行... |
Markdown | UTF-8 | 380 | 3.265625 | 3 | [] | no_license | ---
layout: post
title: Set union
date: '2010-02-17T08:12:48+01:00'
tags:
- ruby
- beginner
tumblr_url: http://rubyquicktips.com/post/394315590/set-union
---
Join two arrays and remove all the duplicates with the pipe operator (|).
[ "a", "b", "c" ] | [ "c", "d", "a" ] # => ["a", "b", "c", "d"]
This is taken from th... |
C# | UTF-8 | 429 | 2.53125 | 3 | [] | no_license | using NUnit.Framework;
namespace AlgoSolving.Task0322_Coin_Change
{
public class Tests
{
[Test]
public void AcceptanceTest1()
{
Assert.That(new Solution().CoinChange(new[] { 1, 2, 5 }, 11), Is.EqualTo(3));
}
[Test]
public void AcceptanceTest2()
... |
Java | UTF-8 | 1,151 | 3.34375 | 3 | [] | no_license | package ch3;
import java.util.Arrays;
import java.util.stream.Collectors;
public class SortSample {
private int[] digits;
public SortSample(int[] digits) {
this.digits = new int[digits.length];
System.arraycopy(digits, 0, this.digits, 0, digits.length);
}
public void sort() {
for (int x... |
TypeScript | UTF-8 | 5,806 | 3.0625 | 3 | [] | no_license | import {
Record,
StateRecord,
InboundRecord,
OutboundRecord,
isStateRecord,
isInboundRecord,
isOutboundRecord,
newStateRecord,
newInboundRecord,
newOutboundRecord,
} from "./db";
import { Processor, Event } from "./processor";
export interface GetOutput<T> {
record: Record;
item: T;
}
export i... |
C++ | UTF-8 | 1,101 | 3.421875 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <string>
#include "Heap.h"
using namespace std;
template <class T>
void heapSort1(T arr[], int n) {
MaxHeap<T> maxHeap = MaxHeap<T>(n);
for (int i = 0; i < n; ++i) {
maxHeap.insert(arr[i]);
}
for (int i = n - 1; i >= 0; --i) {
arr[i] = maxHeap.extractMax();
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.