Tested with angular@5.
npm i @angular/platform-server @nguniversal/express-engine @nguniversal/module-map-ngfactory-loader express @types/express ts-loader@3 rimraf --save-dev
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.beans.factory.annotation.Value; | |
import org.springframework.core.io.Resource; | |
import org.springframework.core.io.ResourceLoader; | |
import org.springframework.http.ResponseEntity; | |
import org.springframework.web.bind.annotation.*; | |
import Java.nio.file.Paths; | |
/** |
package com.empireminecraft.util; | |
import org.bukkit.Bukkit; | |
import java.util.concurrent.ConcurrentLinkedQueue; | |
public class TaskChain { | |
// Tells a task it will perform call back later. | |
public static final Object WAIT = new Object(); |
import java.util.LinkedList; | |
import java.util.List; | |
/** | |
* 描述:红包算法 | |
* User: 曾远征 | |
* Date: 2018-09-17 | |
* Time: 14:09 | |
*/ | |
public class RedPacketTools { |
/** | |
* 描述:雪花算法 | |
* User: 曾远征 | |
* Date: 2018-09-17 | |
* Time: 15:51 | |
*/ | |
public class SnowflakesTools { | |
//开始时间截 (2015-01-01) | |
private final long twepoch = 1489111610226L; |
public class ExecuteSHFile { | |
private static Logger logger = LoggerFactory.getLogger(ExecuteSHFile.class); | |
public static String executeSHFile(String shutdown_path) throws Exception { | |
//执行XXX.sh脚本 | |
Process ps = Runtime.getRuntime().exec("sh "+shutdown_path); | |
//阻塞,直到上述命令执行完成,当返回值为0时表示执行成功 | |
int resultCode = ps.waitFor(); | |
String result=null; | |
logger.info("resultCode"+resultCode); |
/*布隆过滤器(Bloom Filter)是1970年由Burton Howard Bloom提出的。 | |
*它实际上是一个很长的二进制向量和一系列随机映射函数。 | |
*布隆过滤器可以用于检索一个元素是否在一个集合中。 | |
*它的优点是空间效率和查询时间都远远超过一般的算法,缺点是有一定的误识别率和删除困难。 | |
*/ | |
import java.util.BitSet; | |
public class SimpleBloomFilter { |
#!/usr/bin/python | |
# -*- coding: UTF-8 -*- | |
import win32api | |
import win32con | |
class AutoRun(): | |
def __init__(self): | |
name = 'translate' # 要添加的项值名称 | |
path = 'D:\\python_work\\work\dist\\translate.exe' # 要添加的exe路径 | |
# 注册表项名 |
self.setFocusPolicy(Qt.StrongFocus) |
from PyQt5.QtCore import QPropertyAnimation, QRectF, QSize, Qt, pyqtProperty | |
from PyQt5.QtGui import QPainter | |
from PyQt5.QtWidgets import ( | |
QAbstractButton, | |
QApplication, | |
QHBoxLayout, | |
QSizePolicy, | |
QWidget, | |
) |