随笔 - 25, 文章 - 1, 评论 - 0, 引用 - 0
数据加载中……

2010年1月18日

批处理_获取当前时间_BAT

set d=%date:~0,10%
set d=%d:-=%
set d=%d: =0%
set t=%time:~0,8%
set t=%t::=%
set t=%t: =0%
echo 
"%p%%d%%t%"
pause

posted @ 2011-05-03 18:29 至尊贝贝 阅读(1849) | 评论 (0)编辑 收藏

[Java]-[截图]-[获取屏幕某点的RGB]-[代码]

    public static String getHexRGB(int x, int y, Robot robot) {
        
if (robot == null)
            
return "null";
        Dimension dimension 
= Toolkit.getDefaultToolkit().getScreenSize();
        BufferedImage bi 
= robot.createScreenCapture(new Rectangle(00,
                dimension.width, dimension.height));
        
return Integer.toHexString(16777216 + bi.getRGB(x, y));
    }

posted @ 2010-10-29 09:49 至尊贝贝 阅读(343) | 评论 (0)编辑 收藏

[FlashPlayer]-[release]-[离线安装程序]

http://get.adobe.com/cn/flashplayer/otherversions/

posted @ 2010-09-28 16:23 至尊贝贝 阅读(314) | 评论 (0)编辑 收藏

XP系统自动登陆

注册表:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Winlogon
DefaultUserName 值 为要登陆的用户名: 
DefaultPassword 为你的密码:
AutoAdminLogon 值为1

posted @ 2010-09-28 07:55 至尊贝贝 阅读(192) | 评论 (0)编辑 收藏

[chrome][symantec]冲突解决办法

修改注册表 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SysPlant下"Start" DWORD的值为"4"

posted @ 2010-09-26 09:00 至尊贝贝 阅读(457) | 评论 (0)编辑 收藏

[20100822]-[Flex]-[ACTIONSCRIPT]-[数组的深复制]

import flash.utils.ByteArray; 
 
function clone(source:Object):* 

    var myBA:ByteArray 
= new ByteArray(); 
    myBA.writeObject(source); 
    myBA.position 
= 0
    return(myBA.readObject()); 
}

posted @ 2010-08-22 21:37 至尊贝贝 阅读(170) | 评论 (0)编辑 收藏

[Java]-[Enum]-[DBTYPE]

    enum DatabaseProduct {
        ACCESS,
        UNKNOWN,
        DERBY,
        DB2_OLD_AS400,
        DB2_AS400,
        DB2,
        FIREBIRD,
        GREENPLUM,
        HSQLDB,
        INFORMIX,
        INFOBRIGHT,
        INGRES,
        INTERBASE,
        LUCIDDB,
        MSSQL,
        NETEZZA,
        NEOVIEW,
        ORACLE,
        POSTGRESQL,
        MYSQL,
        SQLSTREAM,
        SYBASE,
        TERADATA,
        VERTICA;

        
/**
         * Return the root of the family of products this database product
         * belongs to.
         *
         * <p>For {
@link #DB2_AS400} and {@link #DB2_OLD_AS400} returns
         * {
@link #DB2}; for all other database products, returns the same
         * product.
         *
         * 
@return root of family of database products
         
*/
        
public DatabaseProduct getFamily() {
            
switch (this) {
            
case DB2_OLD_AS400:
            
case DB2_AS400:
                
return DB2;
            
default:
                
return this;
            }
        }
    }

posted @ 2010-07-26 15:15 至尊贝贝 阅读(197) | 评论 (0)编辑 收藏

[20100531]-[BIEE]-[BAT]-[开启和停止BIEE服务]

net stop "sawjavahostsvc"
net stop 
"sawsvc"
net stop 
"Oracle BI Server"

echo 即将开启OracleBiee服务
pause
net start 
"sawjavahostsvc"
net start 
"sawsvc"
net start 
"Oracle BI Server"

posted @ 2010-05-31 17:24 至尊贝贝 阅读(221) | 评论 (0)编辑 收藏

[20100531]-[Javascript]-[IE判断是否网页元素加载完毕]

function document.onreadystatechange()
{

if (document.readyState=="complete"{
    change11();
   }

}

function change11(){
    
    
var year11= (new Date()).getFullYear();
    
    
var targetdiv1 = document.getElementById('idResultsTableParent');
    
var targettable1 = targetdiv1.firstChild;
    targettable1.rows(
0).cells(2).innerHTML=(year11-1)+'年次均费用';
    targettable1.rows(
0).cells(3).innerHTML=(year11-2)+'年次均费用';
    targettable1.rows(
0).cells(4).innerHTML=(year11-3)+'年次均费用';
    targettable1.rows(
0).cells(5).innerHTML=(year11-4)+'年次均费用';
    targettable1.rows(
0).cells(6).innerHTML=(year11-1)+'年同比';
    targettable1.rows(
0).cells(7).innerHTML=(year11-2)+'年同比';
    targettable1.rows(
0).cells(8).innerHTML=(year11-3)+'年同比';
}

只对IE有效

posted @ 2010-05-31 17:17 至尊贝贝 阅读(501) | 评论 (0)编辑 收藏

[20100524]-[Flex4]-[素材颜色]-[一组简单的CHARTS颜色填充]

 

                <mx:fills>

                    
<fx:Array>
                        
<s:RadialGradient>
                            
<s:entries>
                                
<fx:Array>
                                    
<mx:GradientEntry color="#7fe137"
                                                      ratio
="0.3"/>
                                    
<mx:GradientEntry color="#59ab1d"
                                                      ratio
="0.8"/>
                                
</fx:Array>
                            
</s:entries>
                        
</s:RadialGradient>
                        
<s:RadialGradient>
                            
<s:entries>
                                
<fx:Array>
                                    
<mx:GradientEntry color="#249fdf"
                                                      ratio
="0.3"/>
                                    
<mx:GradientEntry color="#1c81b5"
                                                      ratio
="0.8"/>
                                
</fx:Array>
                            
</s:entries>
                        
</s:RadialGradient>
                        
<s:RadialGradient>
                            
<s:entries>
                                
<fx:Array>
                                    
<mx:GradientEntry color="#b222e1"
                                                      ratio
="0.3"/>
                                    
<mx:GradientEntry color="#931cba"
                                                      ratio
="0.8"/>
                                
</fx:Array>
                            
</s:entries>
                        
</s:RadialGradient>
                        
<s:RadialGradient>
                            
<s:entries>
                                
<fx:Array>
                                    
<mx:GradientEntry color="#d21e5a"
                                                      ratio
="0.3"/>
                                    
<mx:GradientEntry color="#a11845"
                                                      ratio
="0.8"/>
                                
</fx:Array>
                            
</s:entries>
                        
</s:RadialGradient>
                        
<s:RadialGradient>
                            
<s:entries>
                                
<fx:Array>
                                    
<s:GradientEntry color="#ccd71f"
                                                     ratio
="0.3"/>
                                    
<s:GradientEntry color="#9ea617"
                                                     ratio
="0.8"/>
                                
</fx:Array>
                            
</s:entries>
                        
</s:RadialGradient>
                    
</fx:Array>
                
</mx:fills>

posted @ 2010-05-24 01:45 至尊贝贝 阅读(285) | 评论 (0)编辑 收藏

[20100524]-[素材]-[颜色]-[一组简单颜色]-[FusionChart使用]

    private static String[] COLOR = "'AFD8F8'""'F6BD0F'""'8BBA00'",
            
"'FF8E46'""'008E8E'""'D64646'""'8E468E'""'588526'",
            
"'B3AA00'""'008ED6'""'9D080D'""'A186BE'" }
;

posted @ 2010-05-24 01:31 至尊贝贝 阅读(180) | 评论 (0)编辑 收藏

[Flex4]-[20100524]-[文件上传]

需要用到的Flex原生态对象

1.FileReferenceList

2.FileReference

3.URLRequest

4.URLVariables


封装对象:
CURL

参考代码:


private var files:FileReferenceList=new FileReferenceList;
files.addEventListener(Event.SELECT, onSelectFiles);
files.browse([
new FileFilter("图片""*.jpg;*.gif;*.png""bmp")]);

protected function onSelectFiles(event:Event):void
{

    
for each (var f:FileReference in files.fileList)
    
{

        var fileItem:Object
=new Object;
        fileItem.file
=f;
        fileItem.name
="NoName";
        fileItem.typeid
=11;
        fileItem.filename
=f.name;
        selectFiles.addItem(fileItem);
    }


}

protected function uploadI_clickHandler(event:MouseEvent):void
{
        
if (selectFiles.length > 0)
        
{

            var item:Object
=selectFiles.removeItemAt(0);

            var curl:CURL
=new CURL;
            curl.url
="UploadImageServlet";
            curl.setData(
"name", item.name);
            curl.setData(
"type", item.typeid);
            curl.setData(
"imagedesc", item.imagedesc);
            var file:FileReference
=item.file as FileReference;
            
if (file != null)
            
{
                file.addEventListener(Event.COMPLETE, onFileUploadComplete);
                file.upload(curl.urlRequest);
            }


        }

        
}

    
protected function onFileUploadComplete(event:Event):void
{
    var f:FileReference
=event.currentTarget as FileReference;
    f.removeEventListener(Event.COMPLETE, onFileUploadComplete);
    uploadI_clickHandler(
null);
}

posted @ 2010-05-24 01:28 至尊贝贝 阅读(604) | 评论 (0)编辑 收藏

[Flex]-[20100524]-[Stream]-[从服务端读取图片]

Flex 如何从服务端读取流信息
参考解决一,从服务端读取Bitmap数据

使用的原生态对象
1 URLStream
2 URLRequest
3 URLVariables  

封装对象:
CURL

源码如下:

package incisive.framework.c.factory
{
 import flash.net.URLRequest;
 import flash.net.URLVariables;

 
public class CURL
 
{

  
public static const urlbase:String="http://localhost:8080/bss/";
  
private var _urlRequest:URLRequest=new URLRequest;
  
private var _url:String;
  
private var vars:URLVariables=new URLVariables;

  
public function CURL(u:String=null)
  
{
   
if (u != null)
   
{
    _urlRequest
=new URLRequest(urlbase + u);
   }

  }


 

  
public function get urlRequest():URLRequest
  
{
   
if (_urlRequest != null)
    _urlRequest.data
=vars;
   
return _urlRequest;
  }


  
public function get url():String
  
{
   
return _url;
  }


  
public function set url(value:String):void
  
{
   _url
=value;
   _urlRequest
=new URLRequest(urlbase + value);
  }


  
public function setData(key:String, value:String, encode:Boolean=false):void
  
{
   
if (encode)
   
{
    vars[key]
=encodeURI(value);
   }

   
else
    vars[key]
=value;

  }

 }

}


 


Stream 如何如下:

 curl:CURL = new CURL;
 curl.url 
= u;
 var imageStream:URLStream
=new URLStream;
 imageStream.load(curl.urlRequest);


posted @ 2010-05-24 01:21 至尊贝贝 阅读(488) | 评论 (0)编辑 收藏

Ajax从服务端读取图片数据

服务端代码:
@Action(value = "/imageload")
    
public String imageLoad ()throws Exception {
        
        File f 
= new File ("d:/down.jpg");
        FileInputStream in 
= new FileInputStream (f);
        
byte[] b = new byte[in.available()];
        in.read(b);
        HttpServletResponse response 
= ServletActionContext.getResponse();
//        response.setCharacterEncoding("UTF-8");
        response.setContentType("image");
        OutputStream pwt 
= response.getOutputStream();
        pwt.write(b);
        pwt.flush();
        pwt.close();
        
return null;
    }
客户端代码:
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding
="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
</head>
<body>
<img id="img1" src=""></img>
<script type="text/javascript">
    
function load() {
        $('#img1').attr('src', 'subject
/imageload.action');
    }
</script>

<button onclick=load();>点击获取</button>
</body>
</html>


posted @ 2010-05-19 17:20 至尊贝贝 阅读(1237) | 评论 (0)编辑 收藏

无语

问题又始于IE与Firefox 试问你用一个最新版的Firefox去与远古级的IE6做比较有意义么, 可是偏偏有许多人喜欢这么去比较,借此来宣传Firefox. 马克思说了很多费话,但还是有一句说的蛮对的,我们要辩证地看待事物. 刘翔他跑了世界冠军破了世界纪录也与我无关, 临场退赛也与我无关,他跑了第一也不代表黄种人就怎么怎么样了 我一直用IE 我也用Firefox 我也用Chrome 我也用Safari 我也不用杀毒软件,我也不中木马病毒. 我就知道,倒卖大蒜,白痴都能挣钱,我也知道,程序员同样龙鱼混杂.我们很少听到龙啸,看到的都是鱼在冒泡. 每天都是IE与Firefox ,Windows与Linux, C与Java

posted @ 2010-05-18 10:10 至尊贝贝 阅读(116) | 评论 (0)编辑 收藏

[20100514]-[FLEX4]-[在SWF中嵌入字体]

起因是 Flex4中使用的仍然是MX的DataGrid 但是因为字体原因 ,使得DataGrid在某些效果上(如Fade|Rotate)可能无效甚至失去响应,解决的办法是把字体嵌入到SWF中去.参考代码:
<fx:Style>
        @namespace s "library://ns.adobe.com/flex/spark";
        @namespace mx "library://ns.adobe.com/flex/mx";
        @namespace bi "com.neusoft.bi.*";
        @namespace widgets "com.neusoft.biframework.widgets.*";
        @font-face {
            src:url("assets/fonts/jsong.ttf"); 
            fontFamily: "jsong";
            embedAsCFF: false;
        }
    
</fx:Style>


<mx:DataGrid x="0"
                     y
="0"
                     id
="grid1"
                     dataProvider
="{data}"
                     width
="100%"
                     height
="100%">
            
<mx:columns>
                
<mx:DataGridColumn headerText="列1"
                                   fontFamily
="jsong"
                                   dataField
="col1"/>
                
<mx:DataGridColumn headerText="列2"
                                   fontFamily
="jsong"
                                   dataField
="col2"/>
                
<mx:DataGridColumn headerText="列3"
                                   fontFamily
="jsong"
                                   dataField
="col3"/>
            
</mx:columns>
        
</mx:DataGrid>

posted @ 2010-05-14 16:33 至尊贝贝 阅读(722) | 评论 (0)编辑 收藏

[20100427]-[源码]-[Java]-[读取文件并输出]

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;

public class Main {

    
/**
     * 
@param args
     
*/

    
public static void main(String[] args) {
        
// TODO Auto-generated method stub
        Main
                .ListFilesInDirectory(
"E://WorkShop/source");
    }


    
static void ListFilesInDirectory(String path) {
        File file 
= new File(path);
        File[] files 
= file.listFiles();
        
for (File fl : files) {
            
if (fl.isDirectory())
                ListFilesInDirectory(fl.toString());
            
else {
                
if (fl.getName().endsWith("java")) {
                    System.out.println(fl.getName());

                    
try {
                        Main.ReadFile(fl);
                    }
 catch (Exception e) {
                        
// TODO Auto-generated catch block
                        e.printStackTrace();
                    }

                }

            }

        }


    }


    
public static void ReadFile(File f) throws Exception {
        BufferedReader br 
= new BufferedReader(new InputStreamReader(
                
new FileInputStream(f)));
        BufferedWriter bw 
= new BufferedWriter(new OutputStreamWriter(
                
new FileOutputStream(new File("d://output1.txt"), true)));
        String tmp 
= new String();
        
while ((tmp = br.readLine()) != null{
            
if (tmp.matches("\\s+"|| tmp.length() == 0)
                
continue;
            
if (tmp.matches("^\\s*(/\\*).*"|| tmp.matches("^\\s*\\*.*")||tmp.matches("^\\s*//.*")
                    
|| tmp.matches("^\\s+\\*/.*")){
                
continue;
            }

            bw.write(tmp);
            bw.newLine();
        }

        br.close();
        bw.close();
    }

}

posted @ 2010-05-06 23:08 至尊贝贝 阅读(159) | 评论 (0)编辑 收藏

Flex报错 : CreateProcess error=2

新安装了一个FlexBuilder3
可是在运行 Application的时候 报出
CreateProcess: "%ProgramFiles%\Internet Explorer\iexplore.exe" G:\java\Flex\........html error=2

Error=2好像是Windows系统返回的错误

且不去管他. ~

打开Eclipse的--Preferences---General---Web Browser---将Default system Web browser 修改成Internet Explorer或Firefox

问题得以解决 `~


至此问题原因 也很明了

因为我的系统已经使用了很多年了~ Windows默认的是IE6吧~ 已经早就升级成了IE8 但是参数Default Web Browser应该还是指向IE6 , 所以出了问题~~
与Eclipse无关~~

posted @ 2010-03-14 11:36 至尊贝贝 阅读(1727) | 评论 (0)编辑 收藏

Google Chrome 离线下载安装包地址


下载地址:dl.google.com/chrome/install/472.53/chrome_installer.exe

472.53为Chrome版本号

posted @ 2010-01-28 00:56 至尊贝贝 阅读(371) | 评论 (0)编辑 收藏

Mysql 中文乱码问题

set names 'utf8' ;
alter database databaseName character set utf8; 
create database mydb character set utf8; 
set character_set_client=utf8;  
set character_set_connection=utf8; 
set character_set_database=utf8; 
set character_set_results=utf8; 
set character_set_server=utf8; 

set collation_connection=utf8_unicode_ci; 
set collation_database=utf8_unicode_ci; 
set collation_server=utf8_unicode_ci;

posted @ 2010-01-25 00:17 至尊贝贝 阅读(113) | 评论 (0)编辑 收藏

Struts2 下报出:Unable to load configuration

Unable to load configuration. - bean - jar:file:/F:/Web/homesite/jsp/struts/WEB-INF/lib/struts2-convention-plugin-2.1.8.jar!/struts-plugin.xml


Struts2下加载的架包:
一般有
:
commons-logging-1.0.4.jar
commons-fileupload-1.2.1.jar
commons-io-1.3.2.jar
struts2-core-2.1.8.jar
xwork-2.1.6.jar
freemarker-2.3.15.jar
ognl-2.7.3.jar
   

posted @ 2010-01-18 23:25 至尊贝贝 阅读(364) | 评论 (0)编辑 收藏