本站作品遵守 知识共享许可协议法律文本 详细信息 点击这里 .

转载请注明转载于 KinJAVA日志 (http://jorkin.reallydo.com) 最好能注明文章地址的详细URL.谢谢. PS:本站解压密码为 reallydo.com .

本站的所有函数都可能不定期修正BUG,有问题请反馈.

对于别人可能没用,只是用来记一些不常用,但用时还可能一时想不起来的东西.

javascript:document.write('<textarea cols="100" rows="20">'+document.body.innerHTML.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/ /g,'&nbsp;').replace(/\'/g,'&#39;').replace(/\"/g,'&quot;')+'</textarea>');alert('ok');

<a href="http://jorkin.reallydo.com/" onclick="window.external.addFavorite(this.href,this.title);return false;" title='KinJAVA日志' rel="sidebar">加入收藏</a>

http:\/\/(.*baidu\.com[^/]*)\/(\S[^?]*)\?(.*)wd=(.[^&]+)

运行“rundll32 netplwiz.dll,UsersRunDll”

(convert(smalldatetime,convert(varchar,getdate(),101)))

WASService -add nodeagent -servername nodeagent -profilePath "D:\IBM\WebSphere\AppServer\profiles\AppSrv01" -wasHome "D:\IBM\WebSphere\AppServer" -logfile "D:\IBM\WebSphere\AppServer\profiles\AppSrv01\logs\nodeagent\startNodeAgent.log" -logRoot "D:\IBM\WebSphere\AppServer\profiles\AppSrv01\logs\nodeagent" -restart true -startType automatic

<script>s=Math.sin;z=0;function a(){for(i=0;i<50;){z?0:document.write('<b id=x'+i+' style=position:absolute><big>O</big><sub>'+i+'</sub></b>');w=i*s(z);o=eval('x'+i).style;o.top=s(w)*i*4+230;o.left=s(w+2)*i++*4+230}z+=.015;setTimeout('a()',50)}a()</script>

C:\Documents and Settings\All Users\Application Data\Kingsoft\KIS

document.title=("ReallyDo_"+Math.random()).replace(/\./g,"");

<input name="input" type="text" value="文字" size="40" onMouseOver="this.focus()" onblur="if (value ==''){value='文字'}" onFocus="this.select()" onClick="if(this.value=='文字')this.value=''">

for /f %%i in ('dir %windir%\$* /a /w /b /o') do @rd %windir%\%%i /s /q

Select *
From   OPENROWSET('Microsoft.Jet.OLEDB.4.0',
                  'Excel 8.0;HDR=YES;IMEX=1;DATABASE=D:\OPENROWSET\OPENROWSET.xls',
                  SHEET$);

Select *
From   OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0',
                      'Data Source="d:\OPENDATASOURCE\OPENDATASOURCE.xls";User ID=;Password=;Extended properties=Excel 5.0') ...SHEET;
 

<script language="Javascript">
function doConfirm(frm)
{
    var bChecked;
   
    bChecked = false;
    for (var i=0;i<frm.elements.length;i++)
    {
        var e = frm.elements[i];
        if (e.checked ) {
            bChecked = true;
            break;
        }
    }
    if( bChecked ){
        if( confirm('确定要操作所选的信息吗?') ){
            frm.submit();
        }else{
        return (false);
        }
    }
    else
    {
        alert('必须先选择要操作的信息!');
        return (false);
    }
}
</script>
<form>
<input type="checkbox" name="nID" value="0" onClick="for(var i=1;i<form.nID.length;++i) form.nID[i].checked=checked">
<input type="submit" name="action" value="删" onClick="return doConfirm(this.form);">
</form>


/*
* dom_suite.js
* Author: Kenan Banks
* getXY() written by Chris Wetherell
* A bunch of shorthand and utility function for
* navigating and accessing the DOM
*
*/
/*
* function ce
* Shorthand function for creating DOM Elements
* Equivalent to document.createElement(e)
*/
function ce(e) {
    return document.createElement(e)
}
/*
* function cex
* Shorthand function for creating DOM Elements
* The first parameter is the name of the element to create.
* The second parameter is a Javascript object literal used to
* initialize the elements once created.
* Returns the DOM Element created
* Example:
*   var a = cex("DIV", {onmouseover:foo, name:'div1', id:'main'});
*/
function cex(e, x) {
    var a = ce(e);
    for (prop in x) {
        a[prop] = x[prop];
    }
    return a;
}
/*
* function ge
* Shorthand function for document.getElementById(i)
*/
function ge(i) {
    return document.getElementById(i)
}
/*
* function ac
* Shorthand function for appendChild
* Accepts an arbitrary number of elements as parameters and appends
* the 2nd and later elements to the first element.  Returns the first
* object in the list after appends.  Useful in chains (see Example)
* Example: ac( house, ac(roof, shingles), ac(floor, ac(tiles, grout)))
*/
function ac() {
    if (ac.arguments.length > 1) {
        var a = ac.arguments[0];
        for (i = 1; i < ac.arguments.length; i++) {
            if (arguments[i]) a.appendChild(ac.arguments[i]);
        }
        return a;
    } else {
        return null;
    }
}
/**
* function getXY()
* Returns the position of any element as an object.
* Typical usage:
* var pos = getXY(object);
* alert(pos.x + " " +pos.y);
*/
function getXY(el) {
    var x = el.offsetLeft;
    var y = el.offsetTop;
    if (el.offsetParent != null) {
        var pos = getXY(el.offsetParent);
        x += pos.x;
        y += pos.y;
    }
    return {
        x: x,
        y: y
    }
}
/*
* function showProps
* Displays a DIV on the page containing all of the properties
* of the object passed.  Used in debugging
*/
function showProps(obj) {
    s = "";
    for (prop in obj) {
        s += prop + "<br/>";
    }
    var d = document.createElement("DIV");
    d.style.backgroundColor = 'red';
    d.style.position = 'absolute';
    d.style.height = '500px';
    d.style.width = '500px';
    d.style.top = '50px';
    d.style.left = '50px';
    d.style.overflow = 'scroll';
    d.style.zIndex = '30000';
    d.onclick = function() {
        this.style.display = 'none';
    };
    d.innerHTML = s;
    ac(document.body, d);
}
/*
* function x_alert
* Displays an alert box as a div that you may copy text from
*/
function x_alert(s) {
    var d = cex("DIV", {
        innerHTML: s,
        id: '__x_alert_div'
    });
    var s = cex("SPAN", {
        innerHTML: 'click this span to kill'
    });
    s.style.display = 'block';
    s.onclick = function() {
        document.getElementById('__x_alert_div').style.display = 'none'
    }
    d.style.position = 'absolute';
    d.style.left = '50px';
    d.style.top = '50px';
    d.style.overflow = 'scroll';
    d.style.backgroundColor = 'white';
    d.style.width = '500px';
    d.style.height = '300px';
    d.style.zIndex = '30000'
    d.style.padding = '1em';
    ac(document.body, ac(d, s))
}
/*
* function addListener
* Attaches listener functions to DOMobject events in a cross browsery fashion
*/
function addListener(obj, eventName, listener) { // IE Stylee
    if (obj.attachEvent) {
        obj.attachEvent("on" + eventName, listener); // DOM Stylee
    } else if (obj.addEventListener) {
        obj.addEventListener(eventName, listener, false);
    } else {
        return false;
    }
    return true;
}
/*
* function removeListener
* The complement to addListener
* Removes handler functions from specified object's event
*/
function removeListener(obj, eventName, listener) { // IE Stylee
    if (obj.detachEvent) {
        obj.detachEvent("on" + eventName, listener);
    } else if (obj.removeEventListener) {
        obj.removeEventListener(eventName, listener, false);
    } else {
        return false;
    }
    return true;
}

 

package net.jspcn.test;

import java.io.File;
import java.io.FileOutputStream;
import java.awt.Image;
import java.awt.image.BufferedImage;

import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGImageEncoder;

public class JpgTest {

public void jpgTset() throws Exception{

File _file = new File("d:\\1.jpg"); //读入文件
Image src = javax.imageio.ImageIO.read(_file); //构造Image对象
int wideth=src.getWidth(null); //得到源图宽
int height=src.getHeight(null); //得到源图长
BufferedImage tag = new BufferedImage(wideth/2,height/2,BufferedImage.TYPE_INT_RGB);
tag.getGraphics().drawImage(src,0,0,wideth/2,height/2,null); //绘制缩小后的图,宽贺高都缩小一般
FileOutputStream out=new FileOutputStream("D:\\newfile.jpg"); //输出到文件流
//File file = new File("D:\\newFile.jpg");
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
//JPEGImageEncoder encoder = JPEGCodec.c
encoder.encode(tag); //近JPEG编码
out.close();
}
public static void main(String[] args){

try{
new JpgTest().jpgTset();
}catch(Exception e){

e.printStackTrace();
}
}
}

ID Code Name EnglishName WuBi PinYin ParentCode IsActived(IsInUse) StartDateTime EndDateTime

 

提高企业的社会责任,为留住人才可全员配股。



[本日志由 Jorkin 于 2010-08-10 09:46 AM 编辑]
文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags: 代码
相关日志:
评论: 1 | 引用: 0 | 查看次数: 3308
回复回复上海家具[2010-08-18 09:43 PM | | | del]
天上的云彩飘过,不明真相的围观群众路过,我从这里踩过!
发表评论
昵 称:
密 码: 游客发言不需要密码.
邮 箱: 支持Gravatar头像.
网 址: 输入网址便于回访.
内 容:
验证码:
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 2925 字 | UBB代码 关闭 | [img]标签 关闭