自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

^_^-Beluga, ^_^-Stefli

Everyday is full of joy!

  • 博客(248)
  • 收藏
  • 关注

原创 Translate C++ Dijkstra to Javascript version

The C++ Dijkstra is at:http://www.cnblogs.com/tanky_woo/archive/2011/01/19/1939041.htmlCalculate the path from 1 to 5!Here is the Javascript version which is translated from above vers

2011-12-02 13:01:20 1377

原创 Set wlan for mobile devices in Wn7

Add a bat file(wlan.bat) with content:netsh wlan set hostednetwork mode=allow ssid=testt key=12345678netsh wlan start hostednetworkpause

2011-09-26 12:26:22 757

原创 "your computer needs to restart" when install Windows 8 on Virtualbox

When i install the Windows 8 Preview on Virtualbox, it always stopped at black screen with "your computer needs to restart, params.....".A

2011-09-16 08:48:38 3996

原创 消防安全培训总结

1、 哨子:对于家中有老人,特别是独居老人或有慢性病老人的的非常重要,一旦老人独自在家发生意外(摔伤、生病、紧急情况)而导致行动不便或无力呼救时,随手可拿的哨子将能够引起邻居或救援人员注意。如遇地震等情况,哨子也能够起到呼救功能。再配个手电给老人放床头。 2、 厨房:用肥

2011-08-09 08:54:50 3343

转载 Keycode list

Just for reminder.key: { a: {code: 65}, b: {code: 66}, c: {code: 67}, d: {code: 68}, e: {code: 69}, f: {code: 70}, g: {code:

2011-08-01 17:17:38 615

原创 Create menu by javascript dynamically

There are many ways to create menu dynamically:1. Spit url by "/", then create menu for each part.You can search the solution from internet,

2011-07-27 13:24:46 626

原创 Sample of HTML 5 game development

Just a sample of HTML 5 game development. var VehicleGame = function() { var ctx; var goRight = false, goLeft = false, paus

2011-07-26 17:43:16 643

原创 Convert string to JSONObject by net.sf.json library

Just for reminder.JSONObject json = (JSONObject) JSONSerializer.toJSON( jsonTxt );

2011-07-19 18:04:22 1661

原创 An effective way to use pattern to instead of multiple if else statements

We often face many if-else statements during the development, that's a little boring.We can use pattern to change this, such as Strategy, an

2011-07-19 15:14:39 693

原创 Assign privilege to SA for drawing the relationship diagram in MsSQL

When click "Database relationship diagram" in MsSQL, warning "此数据库没有有效所有者" will be shown up.To fix this issue, just execute below sql to ass

2011-07-14 15:03:42 476

原创 You should know this about google(plus)

203.208.46.29 picadaweb.google.com203.208.46.29 lh1.ggpht.com203.208.46.29 lh2.ggpht.com203.208.46.29 lh3.ggpht.com203.208.46.29 lh4.ggpht.c

2011-07-07 12:33:38 546

原创 Display the google map in jQuery ui dialog

Use the default settings, the google map can be displayed in a separate page. But, cant be displayed in the jQuery dialog. After debug in Firebug, i found that the major javascripts are never be load

2011-06-30 15:48:00 1197

原创 Three linkage menu for Province, City, County

To load adzone faster, we need to use ajax to load the province, city or county when its parent changed.Here is the major code:1. Main page<%@ page language="java" contentType="text/html; chars

2011-06-23 17:46:00 1872

转载 How to open the dialog out of iframe by using jquery dialog

The solution is from http://stackoverflow.com Once, i want to trigger the dialog in iframe, and want it to be openned in the parent page. but it always displayed in the iframe. Here is a solut

2011-06-23 10:06:00 1400

原创 Continue & break function in .each() function

If you want to do "continue" in an .each() loop, you can use below code segment to implement it.  $(div).each(function (index, el) { if (index == 0) { return true; }}); 

2011-06-22 10:24:00 637

转载 Client-side table sorting for flexigrid

Writer:   Dustkicker  ----------------------------------------------------------------------------------------I wrote a function to perform sorting of the table loc

2011-06-16 14:42:00 881

转载 事务的传播性

1.Required:共享型若1处在一个事务中调用了2,则2直接和1在同一个事务中。若1没有任何事务,则系统会默认给2创建一个新事务。此策略适合大多数情况。2.RequiredNew:独立型若1在一个事务中调用了2,则系统先将1的事务挂起,不管、之后为2设置一个新事务,执行完毕后恢复1的事务。若1没有事务,则会为2新开一个事务。3.Mandatory:强制共享型若1处在一个

2011-06-13 22:02:00 737

原创 Specify the column on one-to-many

If we want the relatioship is TestParent.testNo = TestChild.testNo, do not use the identity column "id".We should specify the columns in mapping file, such as:<class name="com.stefli.model.TestPar

2011-06-09 13:56:00 651

原创 How to format date/datetime in struts2

<br />1. Use param<br /><s:textfield name="order.entryDt"> <s:param name="value" ><s:date name="order.entryDt" format="MM/dd/yyyy" /></s:param> </s:textfield> <br /> <br />2. Use i18n, you should enable i18n and add i18n properties first.<br />i18n

2011-05-27 11:02:00 926

原创 org.springframework.security.AuthenticationCredentialsNotFoundException: An Authentication object was not found in the SecurityC

<br />Reference:<br />1.5. I get an exception with the message "An Authentication object was not found in the SecurityContext". What's wrong? This is a another debug level message which occurs the first time an anonymous user attempts to access a p

2011-05-24 12:50:00 6564 1

原创 Client can't access Jboss server, the port is not accessable.

<br />Run the JBoss server via:<br /> <br />run.bat -b 0.0.0.0<br /> <br />Then the server can be accessable via http://IP:PORT<br /> 

2011-05-20 10:07:00 755

原创 Jboss 4.2 & hibernate java.lang.NoSuchFieldError: INSTANCE

<br />Just remove the hibernate-annotation.jar from lib

2011-05-19 18:07:00 1570

原创 org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorre

<br />Exception:<br />org.hibernate.StaleObjectStateException:   Row   was   updated   or   deleted   by   another   transaction   (or   unsaved-value   mapping   was   incorrect)<br /> <br />Add a hidden field for hibernate version.<br /> 

2011-05-05 15:52:00 5153 1

原创 How to get bean from tag component

<br />Please refer to:<br />@SuppressWarnings("unchecked") @Override public Component getBean(ValueStack stack, HttpServletRequest request, HttpServletResponse response) { ServletContext servletContext = ServletActionContext .getServletCont

2011-05-04 10:09:00 783

原创 How to let IE support HTML5 tags(aside, section, header, footer, etc..)

<br />Import a html5.js with content below (also can download this js from remysharp.com/html5-enabling-script):<br />// html5shiv MIT @rem remysharp.com/html5-enabling-script// iepp v1.6.2 MIT @jon_neal iecss.com/print-protector/*@cc_on(function(m,c){

2011-04-21 12:17:00 961

原创 Multi IE Tester

<br />http://utilu.com/IECollection/

2011-04-21 11:13:00 631

原创 Build administrative area via Json

<br />We want to build a json string to store the administrative area data, the format would bevar threeSelectData={"省份":{"val":"","items":{"城市":{"val":"","items":{"区县":""}}}},"河北":{"val":"130100","items":{"石家庄市":{"val":"130200","items":{"市辖区":"130101","长安

2011-04-18 23:17:00 600

原创 Customize tag lib 2

<br />We also can customize the tag lib using component class, here are the steps:<br />1. Define the component<br />package com.stefli.core.component.taglib;import java.io.IOException;import java.io.Writer;import javax.servlet.http.HttpServletReques

2011-04-02 13:08:00 546

原创 Customize tag lib 1 (freemarker)

Want to customize a tag lib, we need to do follow the steps:1. Define the component (UIBean)package com.stefli.core.component.taglib;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import org.apache.struts2.

2011-04-02 13:02:00 598

原创 Fix the issue: JVM terminated. Exit code=-1

<br />When restart the Blackberry plug-in, an error happened with "JVM terminated. Exit code=-1.".<br />We can specified the jdk to eclipse.ini to fix this issue, so solution as below:<br /> <br /><br />Add below:<br />"<br /><br />-vm<br />D:/software/jdk

2011-03-11 13:18:00 600

原创 One public IP for different contexts via apache rewrite

<br /><br /><VirtualHost *:82><br />    #ServerName www.example.com<br />    #ServerAlias example.com<br />    #ServerAdmin webmaster@example.com<br /> <br />    RewriteEngine On<br />    RewriteRule ^/aContext(.*)$ http://%{SERVER_ADDR}:8080/bpmApprovalMo

2011-03-01 11:12:00 468

原创 getString() always return 255 when column is larger than 255

<br />I have created a table with a column(varchar(1200), then insert some data to this table.<br />When use Jdbc to get the value of this column, it always return 255 chars, so, we need to solve<br />it via:<br /> <br />select convert(text, columnName) fr

2011-02-18 14:39:00 1038

原创 org.osgi.framework.BundleException: Exception in org.eclipse.core.resources.ResourcesPlugin.start()

<br />Solution:<br /> <br />Just remove the folder under "X:/Documents and Settings/username/workspace/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes"<br /> <br />then restart the Eclipse

2011-01-13 19:54:00 7390 3

原创 Cool, i have fixed the "Access violation writing to 0x00000008" of BlackBerry Simulator(JDE5.0)

<br />This issue only happened in Jde 5.0, so i can't use 9700 or other devices.<br /> <br />I have searched many articles, and no solution found. <br />Some one told me to run "Clean.bat", or restart the Simulator can solve it, but after many tries, i sti

2011-01-10 13:59:00 1366

原创 How to setup Apache + Python + Django + mod_wsgi

<br /><br />Apache + Python + Django + mod_wsgiInstallation Guideline<br /> <br />1.  InstallApache<br />Install the apache follow the instruction.<br /> <br />2.  InstallPython<br />Add “D:/software/Python27” and “D:/software/Python27/Scripts”to %

2010-12-22 14:46:00 740

原创 How to setup Apache and mod_python and django

<br />Here is the tutorial:<br /> <br /> <br />1. Install Apache2.2<br />Please refer to other article!<br /> <br />2. Install mod_python<br />Please go to mod_python site to download the compatible version, then install it.<br />After the installation, a

2010-12-22 12:30:00 575

转载 Add Locales

<br />Quote: http://code.google.com/p/winelocale/wiki/AddLocalesToDebianAddLocalesToDebian  How to add locale code pages to Debian or Ubuntu systemsIntroduction<br />Generally, Debian, and especially its cousin Ubuntu, attempt to make using Linux as easy a

2010-12-14 13:17:00 603

转载 教你怎么把骗子弄哭

<br /><br />教你怎么把骗子弄哭<br />1.收到骗子要你汇款的短信后先别忙著删除,看看他的卡号是什么银行的,并登陆此银行的网上营业厅,输入该骗子的卡号,密码随便填写,只要3次错误,此卡在24小时之间是不能进行任何的交易了(就是被冻)<br />2.先查出这个手机号的城市,然后找到那个城市的同性恋交友网站,注册帐号,联系方式留下那个手机号码。<br />3.在当地的房屋出租网站发帖,市中心两室一厅,月租300,急出手。24小时开机,同样留下那个电话。<br />4.某银行职员同样收到短信“请把钱

2010-12-13 09:39:00 533

转载 OuterHTML implementation in Firefox

<br />Here is a sample:<br /><html><head><title>FireFox OuterHTML Implementation</title><mce:script type="text/javascript"><!--if(typeof

2010-12-09 10:11:00 399

原创 How to access url via wifi in blackberry emulator

<br />Add below code to url:<br />;interface=wifi<br /><br /><br /><br />StreamConnection conn = (StreamConnection) Connector.open("http://192.168.87.72/data.xml;interface=wifi");<br /> <br />Then we can access the data from above url via blackberry emulat

2010-11-30 16:18:00 526

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除