Skip to content

Instantly share code, notes, and snippets.

@lzxz1234
lzxz1234 / Office2010_Retail2VOL_Activate.cmd
Last active November 2, 2021 11:02 — forked from mogeko/Office2010_Retail2VOL_Activate.cmd
Convert Microsoft Office VOL License to a Retail License.
@echo off
:ADMIN
openfiles >nul 2>nul ||(
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs" >nul 2>&1
goto:eof
)
del /f /q "%temp%\getadmin.vbs" >nul 2>nul
package com.bj58.hrg.creative.pingjia.web.utils;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import org.apache.log4j.Logger;
import jxl.Cell;
import jxl.Workbook;
import jxl.write.Label;
@lzxz1234
lzxz1234 / Mails.java
Last active December 2, 2016 06:26
Mails
package com.bj58.hrg.creative.pingjia.web.utils;
import java.util.Properties;
import javax.activation.DataHandler;
import javax.mail.Address;
import javax.mail.Message;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
@lzxz1234
lzxz1234 / Traffic.java
Created August 31, 2016 01:51
Traffic
public class Traffic {
private long[] timestamps;
private int index = 0;
private long unitTime;
public Traffic(long unitTime, int maxTraffic) {
if (unitTime < 1L)
throw new IllegalArgumentException("Unit time must be greater than or equal 1ms!");
if (maxTraffic < 1)
@lzxz1234
lzxz1234 / Lang.java
Last active September 23, 2016 12:24
Lang
package com.bj58.zb.service.core.utils;
import static org.apache.commons.collections.ComparatorUtils.naturalComparator;
import static org.apache.commons.collections.ComparatorUtils.nullHighComparator;
import static org.apache.commons.collections.ComparatorUtils.reversedComparator;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@lzxz1234
lzxz1234 / ASTReference.java
Created January 22, 2016 10:20
Velocity 自动 escape 防 XSS 版
package org.apache.velocity.runtime.parser.node;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.velocity.app.event.EventHandlerUtil;
import org.apache.velocity.context.Context;
import org.apache.velocity.context.InternalContextAdapter;
import org.apache.velocity.exception.MethodInvocationException;
import org.apache.velocity.exception.TemplateInitException;
import org.apache.velocity.exception.VelocityException;
import org.apache.velocity.runtime.Renderable;
package com.bj58.ecat.emc.diywebsite.message.utils;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.Semaphore;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.log4j.Logger;
import com.bj58.ecat.redis.utils.StringUtils;
@lzxz1234
lzxz1234 / AutoSolveFileDao.java
Last active June 8, 2017 02:21
XCMS 自处理图标用DAO
import java.util.Enumeration;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.commons.io.FileUtils;
import org.nutz.lang.Mirror;
import org.nutz.lang.Strings;
import org.nutz.mvc.upload.TempFile;
//
// _oo0oo_
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// ___/`---'\___
// .' \\| |// '.
// / \\||| : |||// \
// / _||||| -:- |||||- \
@lzxz1234
lzxz1234 / Ugly.java
Created July 11, 2014 06:51
Unicode 版 Helloword
\u0070\u0075\u0062\u006c\u0069\u0063\u0020\u0020\u0020\u0020
\u0063\u006c\u0061\u0073\u0073\u0020\u0055\u0067\u006c\u0079
\u007b\u0070\u0075\u0062\u006c\u0069\u0063\u0020\u0020\u0020
\u0020\u0020\u0020\u0020\u0073\u0074\u0061\u0074\u0069\u0063
\u0076\u006f\u0069\u0064\u0020\u006d\u0061\u0069\u006e\u0028
\u0053\u0074\u0072\u0069\u006e\u0067\u005b\u005d\u0020\u0020
\u0020\u0020\u0020\u0020\u0061\u0072\u0067\u0073\u0029\u007b
\u0053\u0079\u0073\u0074\u0065\u006d\u002e\u006f\u0075\u0074
\u002e\u0070\u0072\u0069\u006e\u0074\u006c\u006e\u0028\u0020
\u0022\u0048\u0065\u006c\u006c\u006f\u0020\u0077\u0022\u002b