最敬愛的夫人:
過去的一年中,我在您的直接領導下,在岳父岳母的英明指導下,在大小姨子的集體關懷下,遵照您的指示,按照您的部署,兢兢業業、恪盡職守,摸爬滾打、積極進取,各項家庭工作均取得顯著成效。據統計,至去年底,咱家的銀行存款、股票市值、固定資產三項指標分別比前年增長了18%、19%、20%。超額完成了去年初制定的“三項指標增幅要達到12%”的任務,同時咱家還被本胡同評為“五好家庭”,我被本樓道評為“最稱職老公”,您則光榮當選“最幸福太太”,實現了物質文明、精神文明的雙豐收。現將本人一年來的工作情況總結如下:
一、以“服務夫人”為工作重心,抓好家庭日常工作
二、以“夫人旨意”為工作重點,抓好家庭經濟建設。過去的一年中,我認真貫徹夫人去年初作出“要把家庭經濟搞上去”的重要指示,采取得力措施,加大工作力度,狠抓經濟建設,終有所成,家庭三項經濟指標均比前年大幅度增長。我的主要做法是:
1、 嚴格遵守財經紀律。去年,我不折不扣地執行了工資、獎金等主營收入悉數上交,再由夫人回撥零用錢的收支兩條線政策,其余副業收入納入預算資金管理,向夫人打報告審批使用,在過去的一年中,由于我財經紀律做到了不截留挪用,不擠占亂花,不隱瞞收入,不設小金庫,使夫人總攬大權的地位得到了進一步鞏固,家庭收入管理規范,資金專項使用。
2、 厲行個人節約,注重自我節流。過去的一年中,我戒煙、戒酒、戒茶、戒零食、戒請客,總之,將個人吃穿用度費用降至最底,每月零用錢均有剩余,積蓄一定時日,購買首飾、衣物若干贈于夫人,既增加家庭固定資產,又給夫人帶來驚喜,一舉兩得。
3、積極探索,廣開財路。一是充分發揮自身所長,筆耕不輟,投稿報刊、雜志賺取稿費。二是深入領會《麻將致勝大全》要點,掌握致勝技藝,與同事親友小賭怡情,勝多負少,小有收獲。三是苦心鉆研炒股方法,向夫人申請專項資金投身股海,一級市場守株待兔,二級市場低買高賣,一年下來贏利頗多。
三、以“夫人喜好”為出發點,抓好家庭安定團結。過去的一年,我始終以“夫人喜好”為標準,一切聽從夫人,聽從夫人一切,不斷規范自身行為,搞好家庭安定團結,主要有:
1、婚前死黨小黃、小李、小謝、小軍、小楊諸人一向好吃懶做,行事全無章法,經常來家騙吃騙喝,以夫人不喜,我遂將彼等列入損友名單,遂一割袍斷義,中斷往來(注:小李因欠我債務的緣故,暫還保持聯系)。
2、過去我好吸煙,一天兩包不在話下,夫人惡之,去年伊始,我便痛下決心,誓與煙絕。如今,癮來時,我至多點蚊香一支嗅其味以解饞。
3、前年我看望父母次數多于看望岳父岳母一次,夫人不悅,去年我遂積極整改,以實際行動糾正偏差,據統計,至去年底'我看望岳父岳母次數超出看望父母次數兩次,在時間總量上超出45分鐘,在孝敬財物總額上超出21元人民幣。
4、央視主持人劉儀偉,風格清新,廚藝一絕'夫人愛甚,視為新好男人,我遂理一板寸頭,學一口鳥腔普通話,苦研《天天廚藝》菜譜,每日推出一樣特色小菜。
由于我緊緊把握“夫人永遠是對的'如果夫人錯了,我請參照上句執行”的方針,認真貫徹“打不還手,罵不還口,夫人一腳踹過來,我就躲著走”的基本原則,家庭安定團結局面一派大好,夫妻相敬如賓,居家氣氛溫馨。在過去的一年里,我主持家庭日常工作雖取得一定成績,但離夫人的要求仍存在大小差距,如:工作主觀能動性還有待加強,工作前瞻性不足;工作尚存在畏難情緒等,在新的一年中,我將克服缺點、發揚優點,在鞏固去年成績的基礎上,百尺竿頭更進一步,使咱家的生活水準芝麻開花節節高,夫妻恩愛此情綿綿無絕期。
抄報:岳父、岳母
抄送:大姨子、大舅子、小姨子、小舅子、各位連
有時候在我們的網絡應用中,防止程序自動登錄搞破壞,我們一般都會加上驗證碼,這些驗證碼一般來說都是由人來識別的,當然,如果驗證碼很有規律,或者說很清楚,漂亮,那么也是可能被程序識別的,我以前就識別過某網站的驗證碼,因為比較有規律,所以被識別了,并且識別率達到99%左右,其實我們可以制作很復雜一點的驗證碼,添加一些干擾的線條或者字體變形,使程序識別的難度加大,這樣,我們的目的也就達到了.
下面是生成的圖片:
package com.hadeslee;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Font;
import java.awt.GradientPaint;
import java.awt.Graphics2D;
import java.awt.GraphicsEnvironment;
import java.awt.Paint;
import java.awt.Point;
import java.awt.Stroke;
import java.awt.image.BufferedImage;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Random;
import javax.imageio.ImageIO;
import javax.servlet.*;
import javax.servlet.http.*;
/**
*
* @author lbf
* @version
*/
public class Code extends HttpServlet {
/** Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
* @param request servlet request
* @param response servlet response
*/
private List<String> fonts=new ArrayList<String>();
public Code(){
initFonts();
}
private void initFonts(){
GraphicsEnvironment.getLocalGraphicsEnvironment().preferLocaleFonts();
String[] names=GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames(Locale.CHINA);
for(String s:names){
char c=s.charAt(0);
if(Character.isLowerCase(c)||Character.isUpperCase(c)){
}else{
fonts.add(s);
}
}
}
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("image/jpeg;charset=UTF-8");
OutputStream out=response.getOutputStream();
BufferedImage bi=new BufferedImage(200,50,BufferedImage.TYPE_INT_RGB);
Graphics2D g=bi.createGraphics();
char[] cs={'0','1','2','3','4','5','6','7','8','9'};
char[] use=new char[4];
g.setColor(new Color(240,240,240));
g.fillRect(0,0,200,50);
for(int i=0;i<4;i++){
Point p=getPoint(i);
int size=getSize();
use[i]=cs[(int)(Math.random()*cs.length)];
// g.setColor(new Color((int)(Math.random()*256),0,(int)(Math.random()*256)));
g.setPaint(getPaint(p,size));
g.setFont(new Font(fonts.get((int)(Math.random()*fonts.size())),getFace(),size));
g.drawString(""+use[i],p.x,p.y);
}
g.setStroke(new BasicStroke(1.0f));
g.setPaint(null);
for(int i=0;i<4;i++){
g.setColor(new Color((int)(Math.random()*0x00FFFFFFF)));
g.drawLine((int)(Math.random()*200),(int)(Math.random()*50),(int)(Math.random()*200),(int)(Math.random()*50));
}
Random random = new Random();
for (int i=0;i<88;i++) {
int x = random.nextInt(200);
int y = random.nextInt(50);
g.setColor(new Color((int)(Math.random()*0x00FFFFFFF)));
g.setStroke(getStroke());
g.drawLine(x,y,x,y);
}
ImageIO.write(bi,"JPEG",out);
out.close();
g.dispose();
}
private Stroke getStroke(){
BasicStroke bs=new BasicStroke((float)(Math.random()*3));
return bs;
}
private Point getPoint(int index){
return new Point(5+(index*((int)(Math.random()*10)+40)),40);
}
private Paint getPaint(Point p,int size){
GradientPaint gp=new GradientPaint(p.x,p.y,new Color((int)(Math.random()*256),0,(int)(Math.random()*256)),
p.x,p.y-size,new Color((int)(Math.random()*256),(int)(Math.random()*256),(int)(Math.random()*256)));
return gp;
}
private int getFace(){
if(Math.random()*10>5){
return Font.BOLD;
}else{
return Font.ITALIC;
}
}
private int getSize(){
int[] sizes=new int[20];
for(int i=0;i<20;i++){
sizes[i]=30+i;
}
return sizes[(int)(Math.random()*sizes.length)];
}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/** Handles the HTTP <code>GET</code> method.
* @param request servlet request
* @param response servlet response
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/** Handles the HTTP <code>POST</code> method.
* @param request servlet request
* @param response servlet response
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/** Returns a short description of the servlet.
*/
public String getServletInfo() {
return "Short description";
}
// </editor-fold>
}
package com.finegold.digimus.service.config;
import java.util.Date;
import java.util.List;
import org.apache.log4j.Logger;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;
import com.finegold.digimus.comm.StringHelper;
import com.finegold.digimus.lucene.index.service.imp.AddCatalogArticleDataDocument;
import com.finegold.digimus.lucene.index.service.imp.AddMediaContentDocument;
import com.finegold.digimus.lucene.index.service.imp.IndexFactory;
import com.finegold.digimus.service.CatalogArticleDataService;
import com.finegold.digimus.service.MediaContentService;
import com.finegold.digimus.service.bean.IndexPath;
/**
* @author 汪心利 2007-9-6 下午03:41:29
* @copyRigth FineGold 2007
* @Describle 定時創建Lucene索引任務的定時器
*/
public class IndexQuartz extends QuartzJobBean {
private Logger logger = Logger.getLogger(IndexQuartz.class);
private MediaContentService mediaContent;
private CatalogArticleDataService catalogArticleData;
private IndexPath indexPath;
/**
* @return the indexPath
*/
public IndexPath getIndexPath() {
return indexPath;
}
/**
* @param indexPath
* the indexPath to set
*/
public void setIndexPath(IndexPath indexPath) {
this.indexPath = indexPath;
}
/**
* @return the catalogArticleData
*/
public CatalogArticleDataService getCatalogArticleData() {
return catalogArticleData;
}
/**
* @param catalogArticleData
* the catalogArticleData to set
*/
public void setCatalogArticleData(
CatalogArticleDataService catalogArticleData) {
this.catalogArticleData = catalogArticleData;
}
/**
* @return the mediaContent
*/
public MediaContentService getMediaContent() {
return mediaContent;
}
/**
* @param mediaContent
* the mediaContent to set
*/
public void setMediaContent(MediaContentService mediaContent) {
this.mediaContent = mediaContent;
}
@Override
protected void executeInternal(JobExecutionContext arg0)
throws JobExecutionException {
//在這里加入你的操作
StringBuffer logInfo = new StringBuffer();
logInfo.append("在").append(StringHelper.encodeHTML(new Date())).append(
"開始執行創建索引的任務調度");
logger.info(logInfo.toString());
try {
List m_list = mediaContent.findByMediaid(null, null);
IndexFactory.getInstance().createIndex(m_list,
new AddMediaContentDocument(),
indexPath.getMediaIndexPath());
List c_list = catalogArticleData.loadAllData();
IndexFactory.getInstance().createIndex(c_list,
new AddCatalogArticleDataDocument(),
indexPath.getCatalogIndexPath());
logger.info(StringHelper.encodeHTML(new Date()) + "創建索引任務完成!");
} catch (Exception e) {
logger.error("使用Spring定時器創建索引出錯!");
}
}
}
然后在applicationContext.xml中配置:
<!-- =========================Quartz TimeTask 配置 ========================= -->
<bean id="indexJob"
class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass">
<value>
com.finegold.digimus.service.config.IndexQuartz<!-- 剛剛寫的類-->
</value>
</property>
<property name="jobDataAsMap">
<map><!-- 類里一些屬性 key:propertyName-->
<entry key="indexPath">
<ref local="indexPath" />
</entry>
<entry key="catalogArticleData">
<ref bean="catalogArticleDataService" />
</entry>
<entry key="mediaContent">
<ref bean="mediaContentService" />
</entry>
</map>
</property>
</bean>
<!-- 配置那個任務在何時執行 -->
<bean id="cronTrigger"
class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail">
<ref bean="indexJob" />
</property>
<property name="cronExpression">
<value>0 9 * * * ?</value>
<!--<value>* * 23 * * ?</value>-->
</property>
</bean>
<!-- 將任務放入 SchedulerFactoryBean-->
<bean id="scheduler"
class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="cronTrigger" />
</list>
</property>
</bean>
這只是其中的一種方式,還有其它的方式。請等待......
|