统一结果返回 目前的前后端开发大部分数据的传输格式都是json,因此定义一个统一规范的数据格式有利于前后端的交互与UI的展示。 统一结果的一般形式 是否响应成功; 响应状态码; 状态码描述; 响应数据 其他标识符 结果类枚举 前三者可定义结果枚举,如:success,code,message。 @G ...
分类:
其他好文 时间:
2020-06-23 21:47:03
阅读次数:
73
这个函数我没试过 不知道好不好用 function htmltotxt($document){ $search = array('@<script[^>]*?>.*?</script>@si', // Strip out javascript '@<[\\/\\!]*?[^<>]*?>@si', / ...
分类:
Web程序 时间:
2020-06-22 15:44:24
阅读次数:
64
Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of elements in this subset satisfies: Si % Sj = 0 or ...
分类:
其他好文 时间:
2020-06-21 22:53:58
阅读次数:
60
使用Linq group by 查询 一般我们都会这样写Linq:var result = (from si in model.table group si by si.NumCores into grp orderby grp.Key select new CoreCount { Cores = ...
分类:
数据库 时间:
2020-06-21 10:10:46
阅读次数:
100
public class Test {public void dateDiff(String startTime, String endTime, String format) {//按照传入的格式生成一个simpledateformate对象SimpleDateFormat sd = new Si ...
分类:
编程语言 时间:
2020-06-20 14:07:00
阅读次数:
66
shutdown 命令可以用来进行关机程序,并且在关机以前传送讯息给所有使用者正在执行的程序,shutdown 也可以用来重开机。 命令 语法 参数 参数说明 shutdown shutdown [-t seconds] [-rkhncfF] time [message] -t seconds 设定 ...
分类:
系统相关 时间:
2020-06-20 11:34:07
阅读次数:
69
CPU:top top -H -p PIDprintf %x PPIDjstack pid | grep UPID vmstat 1procs memory swap-- io -system-- cpu r b swpd free buff cache si so bi bo in cs us s ...
分类:
其他好文 时间:
2020-06-20 10:36:52
阅读次数:
63
冒泡排序是一个比较简单的排序 但我觉得冒泡排序有一个小点(因为有些同学都不加) 冒泡排序可以设置一个flag来判断是否排完序,如果一遍排下来没有进行交换,就算是排完了,就不需要之后的循环,可以直接break。 代码: void pop(int *arr,int size){ for(int i=si ...
分类:
编程语言 时间:
2020-06-19 21:04:22
阅读次数:
59
# coding: utf-8 import requests import time import datetime import sys import logging import urllib import json reload(sys) sys.setdefaultencoding('ut ...
分类:
其他好文 时间:
2020-06-18 12:51:44
阅读次数:
53
1.自定义sink 在flink中,sink负责最终数据的输出。使用DataStream实例中的addSink方法,传入自定义的sink类 定义一个printSink(),使得其打印显示的是真正的task号(默认的情况是task的id+1) MyPrintSink package cn._51doi ...
分类:
其他好文 时间:
2020-06-16 23:19:16
阅读次数:
61