#source code
cdef extern from "math.h":
double log10(double)
double sqrt(double)
epoch = datetime(1970, 1, 1, tzinfo = g.tz)
cpdef double epoch_seconds(date):
TRANSACTION(事务隔离级别) | |
1. ISOLATION_DEFAULT:这是一个PlatfromTransactionManager默认的隔离级别,使用数据库默认的事务隔离级别。 | |
每种数据库的默认隔离级别是不同的,例如SQL Server、Oracle默认Read Commited,MySQL默认Repeatable Read。 | |
另外四个与JDBC的隔离级别相对应,不同的隔离级别采用不同的锁类型来实现,在四种隔离级别中,Serializable的 | |
隔离级别最高,Read Uncommited的隔离级别最低。 | |
2. ISOLATION_READ_UNCOMMITTED:读未提交数据,这是事务最低的隔离级别,在并发的事务中,它充许一个事务可以 | |
读到另一个事务未提交的更新数据。(会出现脏读,不可重复读和幻读) | |
3. ISOLATION_READ_COMMITTED:读已提交数据,保证在并发的事务中,一个事务修改的数据提交后才能被另外一个事 |
/** | |
* 判断一个字符是否emoji表情字符 | |
* | |
* @param ch | |
* 待检测的字符 | |
*/ | |
public static boolean isEmoji(char ch) { | |
return !((ch == 0x0) || (ch == 0x9) || (ch == 0xA) || (ch == 0xD) | |
|| ((ch >= 0x20) && (ch <= 0xD7FF)) | |
|| ((ch >= 0xE000) && (ch <= 0xFFFD)) || ((ch >= 0x10000) && (ch <= 0x10FFFF))); |
#source code
cdef extern from "math.h":
double log10(double)
double sqrt(double)
epoch = datetime(1970, 1, 1, tzinfo = g.tz)
cpdef double epoch_seconds(date):
import blade.kit.DateKit; | |
public class TopicRank { | |
/** | |
* 计算帖子权重 | |
* @param stars 点赞数 | |
* @param comments 评论数 | |
* @param sink 下沉数 | |
* @param create 创建时间 |
import java.io.UnsupportedEncodingException; | |
public class Base64 { | |
private static char[] base64EncodeChars = new char[] { 'A', 'B', 'C', 'D', | |
'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', | |
'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', | |
'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', | |
'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', | |
'4', '5', '6', '7', '8', '9', '+', '/' }; |
/* | |
* Copyright 2008 The Apache Software Foundation | |
* | |
* 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 agreed to in writing, software |
Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.
This solution fixes the error caused by trying to run npm update npm -g
. Once you're finished, you also won't need to use sudo
to install npm modules globally.
Before you start, make a note of any globally installed npm packages. These instructions will have you remove all of those packages. After you're finished you'll need to re-install them.
BufferedImage image = new BufferedImage(144, 32, BufferedImage.TYPE_INT_RGB); | |
Graphics g = image.getGraphics(); | |
g.setFont(new Font("Dialog", Font.PLAIN, 24)); | |
Graphics2D graphics = (Graphics2D) g; | |
graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, | |
RenderingHints.VALUE_TEXT_ANTIALIAS_ON); | |
graphics.drawString("Hello World!", 6, 24); | |
ImageIO.write(image, "png", new File("text.png")); | |
for (int y = 0; y < 32; y++) { |