Jan 08 2008

又套住了两个,哈哈

Category: 乱up当秘笈ssmax @ 21:18:59

昨晚与啊ray和青云出去吃饭,好久没见过啊ray啦,发福咗唔少,原来前一排果单银行提钱被判无期徒刑嘅案就系佢果间银行,新闻焦点啊

柜员机取出假钱—>银行无责
网上银行被盗—>储户责任
柜员机出现故障少给钱—>用户负责
柜员机出现故障多给钱—>用户盗窃,被判无期
银行多给了钱—>储户义务归还
银行少给了钱—>离开柜台概不负责

彼窃钩者诛,窃国者为诸侯;诸侯之门而仁义存焉。。。。世道啊世道。。。

 谈着谈着谈到股票,就告诉了他们一个不确定的消息,结果他们今天一早就进了,结果立刻被套,还是青云的处女股,哈哈哈哈哈哈哈,再提醒一次:股市有风险,入市需谨慎。。。


Jan 07 2008

tcpdump

Category: 技术ssmax @ 13:59:47

tcpdump -A -s0 tcp dst port 80

…忘记了-s 参数 记录一下。。

       -s     Snarf snaplen bytes of data from each packet rather than the default of 68 (with SunOS’s NIT, the minimum is actually 96).  68 bytes is ade-
              quate  for  IP,  ICMP,  TCP  and  UDP but may truncate protocol information from name server and NFS packets (see below).  Packets truncated
              because of a limited snapshot are indicated in the output with ‘‘[|proto]’’, where proto is the name of the  protocol  level  at  which  the
              truncation  has occurred.  Note that taking larger snapshots both increases the amount of time it takes to process packets and, effectively,
              decreases the amount of packet buffering.  This may cause packets to be lost.  You should limit snaplen to the  smallest  number  that  will
              capture the protocol information you’re interested in.  Setting snaplen to 0 means use the required length to catch whole packets.


Jan 07 2008

年度十大新闻

Category: 乱up当秘笈ssmax @ 12:14:08

年度十大新闻
1、《走进科学》终于揭开神农架野人之谜――原来这是一群买不起房的中国人。
2、据国家统计局统计,2007年中国同比没有增长的有:1.工资;2.空气。
3、政治朝鲜化,经济拉美化,物价欧美化,工资非洲化。
4、高昂的医疗费使老百姓得病直接进火葬场的可能将在三年内实现。
5、洪洞黑砖窑-中国人权形象代言人。
6、开发商买不起人民群众的房子就让法院强制执行,那么人民群众买不起开发商的房子是否也可以要求法院强制执行?
7、矿难在检讨中继续,楼价在控制中上升。
8、中国的新闻比小说还要精彩。
9、随着肉价再次上涨,以前开玩笑说猪的“四大理想”中的“全国人民信回教”就快要实现了!
10、CCTV1《晚间新闻》:大陆10月物价上涨6.6%,群众一致表示“对生活影响不大”;CCTV4“海峡两岸”:台湾物价增长4.5%,民众大叫“活不了了”。


Jan 06 2008

无题

Category: 乱up当秘笈ssmax @ 21:32:41

这两天搞了个usb启动盘,用量产工具做成cdrom方式还真是不错,这样带着个小小u盘就可以帮人装机修机了,还真是爽啊。。。

最近在看一部小说,随波逐流之一代军师,文笔还不错,以前粗粗看了几眼就放过了,现在认真看了一下,YY小说看多了,改看一些历史小说也不错,哈哈。


Jan 05 2008

NT Loader + Grub4DOS 多重启动U盘

Category: 技术ssmax @ 15:53:47

NT Loader + Grub4DOS

因为Avlgo引导器默认是不支持多重配置选单的,所以前面我使用了特殊的方式编辑处理Avlgo的引导配置文件,以期解决U盘启动盘符变动引发的问题。从网友的反馈看,这种方式引导DOS启动软盘镜像,失败率还是比较高。基本上出问题的情况都是NT Loader引导正常,但是到Avlgo的环节出错。因此这套方案,依然保留NT Loader作为MBR引导器,用Grub4DOS来引导OS。

1、给U盘写入NTLDR的MBR,此项工作可以用PeToUSE来完成,也可以用其它方式达成目标,如bootsect。


2、把NT Loader所需的文件NTLDR和NTDETECT.COM拷贝到U盘根目录。

3、编辑NT Loader启动菜单Boot.ini。用任何文本编辑器创建一个Boot.ini文件,内容如下:
[boot loader]
timeout=0
default=C:\grldr
[operating systems]
C:\grldr=”Boot Menu”

Boot.ini是NT Loader的菜单配置文件,timeout参数设置的是菜单等待时间,如果在设定的时间(本例为0秒)用户没有进行选择,就自动加载default项默认的项目。

4、拷贝Grub4DOS文件,把Grub4DOS里面的grldr拷贝到U盘根目录;在U盘根目录创建一个Boot文件夹,把Grub4DOS的中文字体文件Fonts.tz和菜单背景图片文件Splash.gz拷贝到这个文件夹下。在U盘根目录创建一个grubidx.txt文件,内容无所谓。

5、把DOS软盘镜像文件dos.ima拷贝到U盘的Boot文件夹下。

6、把老毛桃WinPE里面的WINNT.XPE和WINPE.IS_文件拷贝到U盘根目录;把WXPE文件夹下面的SETUPLDR.BIN拷贝到U盘根目录下并更名为LDRXPE,注意没有后缀哦。把“外置程序”文件夹拷贝到U盘根目录。

7、创建Grub引导菜单文件,用任何纯文本编辑器在U盘根目录创建一个Menu.lst文件,内容为:
timeout 30
default 0
splashimage /boot/splash.gz
foreground ffff00
fontfile /boot/fonts.gz

title 启动 WindowsPE
find –set-root /grubidx.txt
chainloader /ldrxpe

title 启动 MS-DOS 7.1
find –set-root /grubidx.txt
map –mem /boot/dos.ima (fd0)
map –hook
chainloader (fd0)+1
rootnoverify (fd0)

做完这些,U盘就可以启动了。

菜单项目说明:
第一行设置等待30秒的等待时间;
第二行设置如果30秒用户没有选择,就默认启动第一个引导项目“启动 WindowsPE”;
splashimage项目设置Grub4DOS启动菜单的背景图片,图片路径为/boot/splash.gz;
foreground项设置启动菜单文字颜色为亮黄色;
fontfile项设置中文字体文件为/boot/fonts.gz
下面两个以title开头的小节就是启动菜单的两个启动项,title后面的文字将显示在菜单中;
find –set-root /grubidx.txt这一项是自动搜索grubidx.txt这个事先创建好的特征文件,它只要找到这个文件,就把文件所在的路径设置为根设备,这样就不会被盘符变化困扰了。至于特征文件的内容,那就无所谓了。
chainloader /ldrxpe就是启动WinPE的XPE镜像。
map –mem /boot/dos.ima (fd0)是装入/boot/dos.ima这个软盘镜像,并且虚拟成fd0.
map –hook是让装入的软盘镜像立即加载生效。
rootnoverify (fd0)指定把刚才虚拟的fd0设置为根设备。

本来,Grub4DOS可以直接安装到U盘的根目录,但是我反复尝试了多次,MBR是写进去了,可总是报错无法引导。所以还是用NT Loader做MBR引导器,由于NT Loader不支持加载镜像文件,所以MBR引导成功后,把控制权交给Grub4DOS,由Grub4DOS来加载WinPE的XPE镜像以及MS-DOS的软盘镜像实现启动对应OS的功能。


Jan 05 2008

WINPE的目录结构

Category: 技术ssmax @ 13:54:48

自己制作多个PE集成启动盘的时候需要了解

下面介绍了一下pe里的一些文件路径及名称的设置情况:
file://
│AUTORUN.INF //无所谓有无,在windouws中用
│WINNT.XPE //必须放在根目录下,这是一个文本文件,用记事本可以打开,是用来指定WINPE.IS_存放目录的。名称可在SETUPLDR.BIN中更改,名称字符数必须和原来相同
├─MINIPE //外置程序的存放目录,名称和所在路径都可以任意更改,在WXPESYSTEM32PECMD.INI和WINPE.INI中有路径设置
│OP.WIM //外置程序。名称和所在路径都可以任意更改,在WINPE.INI中设置
│WINPE.INI //外置程序配置文件。名称和所在路径都可以任意更改,在解压后的WINPE.IS_中WXPESYSTEM32PECMD.INI中设置
│WINPE.IS_ //pe的核心文件。名称和所在路径都可以任意更改,由WINNT.XPE确定(但注意CAB里面文件名必须为WINPE.ISO)
├─SETUP //将PE从光盘安装到硬盘的工具,与PE启动无关,可以无视掉。
││PESETUP.EXE
││PESETUP.INI
│└─MYINS
│AERO.SYS
│CHECKUSB.EXE
│GRUBGUI.EXE
│GRUBINST.EXE
│HPUSBFW.EXE
│MD5.EXE
│MYINS.DLL
│MYINS.EXE
│NTBOOT.EXE
└─WXPE //存放NTDETECT.COM的目录,名称可修改,必须为4个字符
NTDETECT.COM //Windows NT系统启动文件。路径在SETUPLDR.BIN中更改,且父目录必须为4个字符;名称最好不要改,以免发生未知错误,而且所有的PE都要用这个一文件,光盘上只要有一个就可以。
SETUPLDR.BIN //光盘引导文件。注意,这个是在用grub4dos作引导时的名称和所在路径都可以任意更改,如果用easyboot来作引导,最好只改名称且与原字符个数相同。在UltraISO提取的光盘上引导程序BIF中修改。而我现在讲的就是用grub4dos,简单多了。


Jan 05 2008

U盘量产及启动相关知识

Category: 技术ssmax @ 11:24:17

转自无忧

第一篇 有关量产工具

1. 什么是量产工具,有何作用
    量是指批量的意思,即量产工具可以一次性生产出很多U盘,只要你的USB孔足够。
   
量产工具是针对U盘主控芯片进行操作的由厂商开发的低层软件,作用:
  1)
低格U
  2)
生产加密盘
  3)
分区,可以生产只读分区,更改U盘介质类型(removabel fixed
  4)
量产出USBCDROM,此作用可以做启动光盘。

 

2. 读卡器所组成的U盘能量产吗?
不能,也许以后会有这样的读卡器。

3.移动硬盘能量产吗?
目前不能,芯邦在搞,据说明年会出来。
如果真出来这样的工具,CD\DVD销量可能要大大下降了。

4.所有U盘都能量产吗?
应该是的,就看有没有合适的量产工具放出。主控厂商肯定都有的。

5.如何判断U盘主控
  1)
最准确方法-拆盘
  2)
根据软件vid & pid结合已知的USB厂家列表来判断主控。但vid & pid是可以随意改的,对于劣质flash存储U盘可能不准;另外也可以用VMWARE来判断。参见相关贴子。

6. 什么量产工具好
都差不多,就看熟不熟练。

7. 使用量产工具要注意什么
  1)
不要怕,大胆的弄,U盘不会坏的
  2)
量产也有经常出错的时候,如U盘变成8M,同1),再次进行。

8. 量产出的CDROM最大可以是多少
   
不同版本,牌子不一样,我的4GICREATE的可以量产出1G多点。这个技术指标开发商不透露。

9. 量产工具版本越高越好吗?
不一定,还要看是不是支持你的U盘的类型。

10. 量产出的CDROM启动兼容性、速度怎样?
新主板几乎都可以,老主板有的HDDZIP都不行,但CDROM可以;如果主板支持USB2.0且打开“high speed”,U盘也支持USB2.0这个启动速度是很快的,用来安装XP就是一例。

11. 不同的量产工具为什么不能通用
主要区别在于不同厂家的主控芯片都有其保密的指令与函数,没法通用。

12. 为什么有的CDROM要以启动2次才可以成功
这个,有请高手研究
说到这里,涉及到了BIOS内容,不同BIOS的处理情况不一样,我们这里没有这样的专家。当年BINBINCRACK VISTA的时候,BIOS专家出面,解决了不少问题,当然是针对AWARD的,至于AMI的,还没有这样的公开程序。如果从BIOS层面解决对USBCDROM的识别问题,就太好了。

13. 从哪里可以得到量产工具
  1)从U盘厂家网站,一般主控开发商都给他们主控的。
  2
)从主控开发商网站。
  3
search,包括网络和这里
  4
)打电话或发EMAIL

14. MP3 MP4等设备可以做启动盘吗?
  硬件基本差不多,都可以的。
 

15. 量产成CDROM,剩余空间怎么用?
  剩余空间会被识别成为一个独立的U,可以做成fixed盘,进一步分区;也可以为removable盘。剩余空间可以用来作启动,也可以当成普通U盘储存文件.

16. 量产工具可以在VISTA下运行吗?
  目前不可以,在VISTA下会存在各种错误。

第二篇 U盘启动

1. U盘启动有几种方式


  目前有如下几种:
  1CDROM方式,这个要用量产工具,启动的兼容性较高
  2HDD方式,这个使用率也较高
  3ZIP方式,这个好像要淘汰了
  4FDD方式,这个基本淘汰

2. 哪种启动方式成功率较高
  如上,基本上是1> 2> 3

3. HDD方式或ZIP方式启动PE,有几种方法
  1NTLDR+GRLDR
  2GRUB INSTALLED TO MBR
  3DOS+GRLDR
  4LINUX ETC.+GRLDR
  5NTLDR  INSTALLED TO MBR
  推荐使用第2种和第5种,成功率很高

4. U盘启动的兼容性差吗?
  这是误解,对于老一点的主板,因为BIOS及启动速度的问题,最关键的是标准不统一的问题,启动却有困难,但新出的主板,基本都可以用CDROMHDD方式启动的,且直接支持USB2.0因此,装系统等非常的快。
 

5. U盘启动要注意什么?
  仔细查看你的主板BIOS设置,是否正确设置U盘为第一启动。
  有的主板,USB选项中有“FULL SPEED”“HIGH SPEED”之分,要打开后者,这样速度会很快。
  对于CDROMHDD/ZIP双启动,如果主板没有识别出HDDZIP,则使用CDROM上的GRLDR也搜索不到HDD的。
  一般主要识别出CDROMHDD,都可以启动成功。

6. U盘量产成CDROM方式有什么好处
  这个,都明白,CDROM标准统一,启动成功率高,当然文件也安全。

7. U盘量产后速度为什么变慢
  这个我也在求解,不过,我发现我的量产出的HDD,如果经过HDD重新调整大小,速度却可以变快。

8. 移动硬盘应该用什么格式
  移动硬盘应该使用HDD格式,Xp下格式化然后设置移动硬盘主分区为活动即可

10. 使用量产工具启动CDROM后,另一个U盘分区能否实现启动
  可以,使用HPUSBFWFlashBootU盘启动格式化工具就可以实现

11.为什么U盘启动时加载镜像时间很久
  PE镜像加载的时间取决于你的主板,有些主板上要七八分钟才能加载的镜像,在支持USB2.0启动的主板上也许只要几十秒
 

12.可以从U盘启动,移动硬盘为何不能启动
  首先确认你的移动硬盘已经有PE文件,并且移动硬盘的主分区已经激活(用PTDD重建MBR或者执行FDISK   /MBR),
  然后在插上移动硬盘的情况下,打开BIOS中的硬盘项,里面应该有两个硬盘,把移动硬盘上移到第一位(默认是第二位)。

第三篇 U盘硬件基础

1. U盘硬件组成是什么
    主控芯片+存储芯片
    主控芯片存储控制闪存的信息。有的U盘坏了,通过换主控,内容还不丢失,只要闪存没坏。
    闪存,是外国鬼子搞出来的,目前在中国市的五花八门的U盘大多是国外淘汰的劣质闪存做成的,因此容易坏。

2. 主控有几种
    cbm(chipsbank), icreate, 安国, sandiks etc….

3. 闪存有几种
   从存储方式上分为SLCMLC,后者的存储容量比前者大,但速度与寿命短于前者。

SLCMLC选购与识别:  

“有需求才有会去识别。”--懒人星魂的道理。对于选购,我们不禁要问:要以超过摩尔定律的速度,促成MP3容量的大跃进,我们是选择MLC还是SLC呢?现在MP3随身听市场,是买SLC还是MLC闪存芯片的呢?很明显,对容量要求不高,或者对机器质量、数据的安全性、机器寿命等方面来说,SLC闪存芯片的首选。但是,使用SLC闪存芯片,如果需要2G以上的大容量,成本明显是比较高的。   我们该怎么识别SLCMLC呢?主要有两个方法:  

一、看传输速度,如果有两款产品,采用同一芯片,例如目前非常流行的Rockchip,那么写速有23倍优势的就应该是SLC了,而速度上稍慢的则是MLC  

二、看FLASH型号,如果是采用三星闪存、型号以K9GK9L开头则是MLC,如果采用现代闪存HYUUHYUV也是MLC

详细分别:    

MLCMulti-Level-Cell)技术,由英特尔于1997年率先推出,能够让单个存储单元保存两倍的数据量。MLC内存颗粒是个相当良好的低价解决方案,可大幅节省制造商端的成本,但是MLC NAND颗粒制成的CompactFlash卡相较于SLCSingle-Lecel_Cell) 内存颗粒的产品有着写入速度慢、耗电多、寿命短的缺点,MLC颗粒制成的产品只有10X1.5Mbyte/sec)的写入速度,SLC 颗粒制成的产品可以达到 22X3.2Mbyte/sec)的写入速度。

Item SLC MLC
电压 3.3V/1.8V 3.3V
生产工艺 / 芯片尺寸 0.12um 0.16um
页容量 / 块容量 2KB/128KB 512KB/32KB or 2KB/256KB
访问时间(最大) 25us 70us
页编程时间(典 型) 250us 1.2ms
可否局部编程 Yes No
擦写次数 100K 10K
数据写入速率 8MB/S+ 1.5MB/S

NAND Flash SLCMLC技术解析

许多人对闪存的SLCMLC区分不清。就拿目前热销的MP3随身听来说,是买SLC还是MLC闪存芯片的呢?

在这里先告诉大家,如果你对容量要求不高,但是对机器质量、数据的安全性、机器寿命等方面要求较高,那么SLC闪存芯片的首选。但是大容量的SLC闪存芯片成本要比MLC闪存芯片高很多,所以目前2G以上的大容量,低价格的MP3多是采用MLC闪存芯片。大容量、低价格的MLC闪存自然是受大家的青睐,但是其固有的缺点,也不得不让我们考虑一番。
 

什么是SLC

SLC英文全称(Single Level Cell——SLC)即单层式储存 。主要由三星、海力士、美光、东芝等使用。 

SLC技术特点是在浮置闸极与源极之中的氧化薄膜更薄,在写入数据时通过对浮置闸极的电荷加电压,然后透过源极,即可将所储存的电荷消除,通过这样的方式,便可储存1个信息单元,这种技术能提供快速的程序编程与读取,不过此技术受限于Silicon efficiency的问题,必须要由较先进的流程强化技术(Process enhancements),才能向上提升SLC制程技术。

什么是MLC

MLC英文全称(Multi Level Cell——MLC)即多层式储存。主要由东芝、Renesas、三星使用。 

英特尔(Intel)在19979月最先开发成功MLC,其作用是将两个单位的信息存入一个Floating Gate(闪存存储单元中存放电荷的部分),然后利用不同电位(Level)的电荷,通过内存储存的电压控制精准读写。MLC通过使用大量的电压等级,每一个单元储存两位数据,数据密度比较大。SLC架构是01两个值,而MLC架构可以一次储存4个以上的值,因此,MLC架构可以有比较好的储存密度。
 

SLC比较MLC的优势:
签于目前市场主要以SLCMLC储存为主,我们多了解下SLCMLC储存。SLC架构是01两个值,而MLC架构可以一次储存4个以上的值,因此MLC架构的储存密度较高,并且可以利用老旧的生产程备来提高产品的容量,无须额外投资生产设备,拥有成本与良率的优势。

SLC相比较,MLC生产成本较低,容量大。如果经过改进,MLC的读写性能应该还可以进一步提升。SLC比较MLC的缺点:

MLC架构有许多缺点,首先是使用寿命较短,SLC架构可以存取10万次,而MLC架构只能承受约1万次的存取。
其次就是存取速度慢,在目前技术条件下,MLC芯片理论速度只能达到2MB左右。SLC架构比MLC架构要快速三倍以上。
再者,MLC能耗比SLC高,在相同使用条件下比SLC要多15%左右的电流消耗。
虽然与SLC相比,MLC缺点很多,但在单颗芯片容量方面,目前MLC还是占了绝对的优势。由于MLC架构和成本都具有绝对优势,能满足未来2GB4GB8GB甚至更大容量的市场需求。 

SLCMLC的识别:  一、看传输速度比如有两款采用Rockchip芯片的产品,测试时写入速度有23倍优势的应该是SLC,而速度上稍慢的则是MLC。即使同样采用了USB2.0高速接口的MP3,也不能改变MLC写入慢的缺点。 

二、看FLASH型号
一般来说,以K9GK9L为开头型号的三星闪存则是MLC,以HYUUHYUV为开头型号的现代闪存应是MLC。具体芯片编号以三星和现代为例:三星MLC芯片编号为:K9G******    K9L*****。现代MLC芯片编号为:HYUU****    HYUV***

  简单总结:  如果说MLC是一种新兴的闪存技术,那么它的“新”就只体现在:成本低!
虽然MLC的各项指标都落后于SLC闪存。但是MLC在架构上取胜SLCMLC肯定是今后的发展方向,而对于MLC传输速度和读写次数的问题已经有了相当多的解决方法,例如采用三星主控芯片,wear leveling技术,4bit ECC校验技术,都可以在采用MLC芯片的时候同样获得很好的使用效果,其性能和使用SLC芯片的没有什么差别,而会节省相当多的成本.


Jan 04 2008

好晚了

Category: 乱up当秘笈ssmax @ 22:37:39

今天boss终于走人了,临走时还带咱们领略了一把vista网络启动,哈哈,竟然是用TFTP协议的,以前都没有试过。。。

晚上帮chyi搞机搞到9点半都未搞掂,那台垃圾笔记本早就应该扔掉了,给了张碟他回家慢慢玩。。。我回到家都10点半了,这么夜竟然还塞车,无天理。。。明天睡到10点吧。。。


Jan 03 2008

use TinyMCE in Jira 3.12

Category: 技术ssmax @ 14:30:54

Jira上面用上WYSIWYG编辑器,copy些资料的时候就能爽一点了 ,找了一下,官网上面就有实现,不过有点旧,有些地方也不完全,下面是一点笔记。。

This was a real hassle, and I had hoped to make it a plugin, but I could not figure out how to do some things without changing the Jira Code, so here is where it stands.

We wanted a wysiwyg renderer for our Customer Service folks to be able to copy and paste rich text from Lotus Notes email messages and other items.
TinyMCE seems to be able to do everything we want.
I did see some TinyMCE code in JIRA, but do not know what it’s for and it doesn’t seem to be used.
Anyway, Essentially, we create a new Renderer that does not encode the text in a field to be displayed as text.
Also, we had to add the initialization for TinyMCE to the header jsp.
If you reinitialize, it screws up, so this needs to be done in a single place per page. I could not find a better location than the header.jsp
You also need to add the text fields to the list of things to be rendered by TinyMCE. This is in the edit velocity file.

If anyone can see how to make this a standalone plugin, that would be great, but between the Jira plugin requirements and TinyMCE requirements, it kept running into roadblocks.

To implement do the following:

1: Download TinyMCE from http://tinymce.moxiecode.com/
2: Extract it to jira/src/webapp/includes/js
3: Add the following to the /jira/src/webapp/includes/decorators/header.jsp in a spot where other scripts are being loaded

<script language=”JavaScript” type=”text/javascript” src=”<%= webResourceManager.getStaticResourcePrefix() %>/includes/js/tinymce/jscripts/tiny_mce/tiny_mce.js”></script>
<script language=”javascript” type=”text/javascript”>
tinyMCE.init(
{ theme : “simple”, mode : “exact”
);
</script>

这里记得去改simple的css,要不编辑字体会很小
在 tinymce/jscripts/tiny_mce/themes/simple/css/editor_content.css

4: Add the following to /jira/src/etc/languages/default/com/atlassian/jira/web/action/JiraWebActionSupport.properties

admin.renderer.plugin.wysiwyg.renderer.name=Wysiwyg Style Renderer
admin.renderer.plugin.wysiwyg.renderer.desc=A renderer that will renderer content as entered into a wysiwyg editor.

这步不需要做,新版的jira把languages都封装好了,懒得取改

5: Add the following to /jira/src/etc/java/system-renderers-plugin.xml

<jira-renderer system=”true” key=”jira-wysiwyg-renderer” name=”Wysiwyg Style Renderer”
i18n-name-key=”admin.renderer.plugin.wysiwyg.renderer.name”
class=”com.atlassian.jira.issue.fields.renderer.wysiwyg.WysiwygRenderer”>
<description key=”admin.renderer.plugin.wysiwyg.renderer.desc”>A renderer that will renderer content from a wysiwyg editor.</description>
<resource type=”velocity” name=”edit” location=”/templates/plugins/renderers/wysiwyg/wysiwyg-renderer-edit.vm”/>
</jira-renderer>

6: Create new file /jira/src/java/com/atlassian/jira/issue/fields/renderer/wysiwyg/WysiwygRenderer.java
with the following code

package com.atlassian.jira.issue.fields.renderer.wysiwyg;

import com.atlassian.jira.issue.fields.renderer.JiraRendererPlugin;
import com.atlassian.jira.issue.fields.renderer.IssueRenderContext;
import com.atlassian.jira.plugin.renderer.JiraRendererModuleDescriptor;
import com.atlassian.jira.util.JiraKeyUtils;

/*\*
* A simple text renderer for jira..
\*/
public class WysiwygRenderer implements JiraRendererPlugin
{
public static final String RENDERER_TYPE = “jira-wysiwyg-renderer”;

private JiraRendererModuleDescriptor jiraRendererModuleDescriptor;

public String render(String value, IssueRenderContext context)
{ return JiraKeyUtils.linkBugKeys(value); }
public String renderAsText(String value, IssueRenderContext context)
{ return value; }
public String getRendererType()
{ return RENDERER_TYPE; }
public Object transformForEdit(Object rawValue)
{ return rawValue; }
public Object transformFromEdit(Object editValue)
{ return editValue; }
public void init(JiraRendererModuleDescriptor jiraRendererModuleDescriptor)
{ this.jiraRendererModuleDescriptor = jiraRendererModuleDescriptor; }
public JiraRendererModuleDescriptor getDescriptor()
{ return jiraRendererModuleDescriptor; }
}

7: Create new file /jira/src/etc/java/templates/plugins/renderers/wysiwyg/wysiwyg-renderer-js.vm
with the following code

tinyMCE.init(
{ mode : “textareas” }

);

8: Create new file View of /jira/src/etc/java/templates/plugins/renderers/wysiwyg/wysiwyg-renderer-edit.vm
with the following code

<DIV style=”width:90%”>
#if($singleLine)
<input style=”width:100%”
type=”text”
name=”$fieldId”
value=”$textutils.htmlEncode($!value)”
id=”$fieldId”
class=”textfield”
#if($maxlength)maxlength=”$maxlength”#end
/>
#else
<textarea style=”width:100%”
name=”$fieldId”
id=”$fieldId”
#if($rows)rows=”$rows”#end
#if($wrap)wrap=”$wrap”#end
#if($cols)cols=”$cols”#end
#if($accesskey)accesskey=”$accesskey”#end
class=”textarea”
>$textutils.htmlEncode($!value)</textarea>
#end
</DIV>
<script language=”javascript” type=”text/javascript”>
tinyMCE.execCommand(‘mceAddControl’, true, “$fieldId”);
</script>

不需要重新打包,全部都在服务器那边解压好的地方找,/jira/src/etc/java对应就是WEB-INF/classes的目录了,改好之后重启或者让它自动reload,然后要到jira配置页面里面的Field Configurations->

  

View Field Configuration

 

绿色字的几项选对新的renderers,这里找了我n久才找到,郁闷的狠。。。


Jan 03 2008

音频编码概览(Audio Formats Overview)

Category: 技术ssmax @ 12:49:54
Format Description
AAC AAC means “Advanced Audio Coding”, and in the beginning it was also called MPEG-2 NBC for “Non-Backwards Compatible” as opposed to the MPEG-1 and MPEG-2 BC (with 5.1 channels) standards. It is now considered to be the actual “state of the art” in general audio coding and the natural successor of MPEG-1/2 Layer III / MP3 in the new multimedia standard MPEG-4 that uses MP4 as the container format for all kinds of content.AAC is able to include 48 full-bandwidth (up to 96 kHz) audio channels in one stream plus 15 low frequency enhancement (LFE, limited to 120 Hz) channels and up to 15 data streams. Besides it has further multi-language capacities.MPEG formal listening tests demonstrated that AAC provides an audio quality at 96 kbps which is slightly better than MP3 at 128 kbps and MP2 at 192 kbps.
Dolby Digital AC3 (Multichannels) Dolby Digital (AC-3) is Dolby’s third generation audio coding algorithm. It is a perceptual coding algorithm developed to allow the use of lower data rates with a minimum of perceived degration of sound quality.
Dolby can be stereo or surround and has allowable stereo bitrates from 128k to 384k. 
Usually uses on DVD.
ADPCM (MS, IMA) Compressed WAV format. ADPCM (Adaptive Differential Pulse Code Modulation) is an audio compression scheme which compresses from 16-bit to 4-bit for a 4:1 compression ratio.ADPCM stands for Adaptive Differential Pulse Code Modulation. ADPCM is a lossy compression mechanism. There are various flavors of ADPCM. This particular algorithm was suggested by Microsoft; its quality is similar to IMA (Interactive Multimedia Association) ADPCM. MS ADPCM compresses data recorded at various sampling rates. Sound is encoded as a succession of 4-bit nibbles. Each nibble represents the difference between the current sampled signal value and the previous value. The compression ratio obtained is relatively modest: 16-bit data samples encoded as 4-bit differences result in 4:1 compression format.Microsoft ADPCM is directly supported on most Windows implementations as a native format. Although the quality of IMA ADPCM voice files is not great, the files are portable. There is a real advantage in having compact files that can be played on most Windows PCs.
CCUIT A-LAW Compressed WAV format. A-Law (or CCITT standard G.711) is an audio compression scheme common in telephony applications. It is a slight variation of the u-Law compression format, and is found in European systems. This encoding format compresses original 16-bit audio down to 8 bits (for a 2:1 compression ratio) with a dynamic range of about 13-bits. Thus, a-law encoded waveforms have a higher s/n ratio than 8-bit PCM, but at the price of a bit more distortion than the original 16-bit audio. The quality is higher than you would get with 4-bit ADPCM formats. Encoding and decoding is rather fast and generally, widely supported.
AIFC AIFF is Audio Interchange File Format, a format for storing digital audio samples in a file. This standard format for sound files was defined by Apple.AIFC is short for AIFF(C) or AIFF-C, i.e. the Audio Interchange File Format with optional compression. AIFC is a newer version of the format that includes the ability to compress the audio data. 
AMR Adaptive Multi-Rate CodecThe AMR format is used by many mobile phones right now, for sound recordings and for MMS (message with sound, picture and text for view in cell phones) and will be used in future GSM systems (3G).

Features AMR Narrowband
Bandwidth 200-3400 Hz
Sampling Rate 8000 Hz
Bit-rate (kb/s) audio samples 4.75, 5.15, 5.9, 6.7, 7.4, 7.95, 10.2, 12.2
Type ACELP
DSP Compressed WAV format. DSP Group True Speech (TM) format. DSP Group’s TrueSpeech is a family of high quality, low bit rate, speech compression algorithms which compress speech down to as little as 1/40th its original size. Several different versions of TrueSpeech at different compression rates are available for licensing, from 8.5 Kbps through 3.9 Kbps. All offer excellent communications over a 14.4 Kbps or better modem.TrueSpeech 8.5 is the 8.5 Kbps member of DSP Group’s TrueSpeech family of software products. It is a low complexity speech coder, which is an integral component of Microsoft windows and has also been endorsed by Dialogic for computer telephony products. TrueSpeech 8.5 should be used when compatibility with Microsoft is a prerequisite.

Speech information can now be exchanged compatibly between different applications. For example, using TrueSpeech 8.5 for digital simultaneous voice and data applications (DSVD), it may be feasible to utilize the same DSP chip for both speech compression and high speed modem data pump tasks. At the sampling rate of 8 KHz, continuous digital speech is compressed from 128 Kbps to 8.5 Kbps, a 15:1 compression ratio, while maintaining good speech quality. With slightly lower voice quality and lower levels of compression, TrueSpeech 8.5 requires only about half the MIPS and program memory space as TrueSpeech 6.3 and 5.3.

GSM Compressed WAV format. Good for keeping of human speech. It is lossy speech compression that allows to get telephone quality speech with 13 kbit/s. It is a standard used for telephone sound compression in European countries and its gaining popularity because of its quality.GSM 06.10 stands for Global System for Mobile Communications and is a variant of LPC called RPE-LPC (Regular Pulse Excited – Linear Predictive Coder) and is a European standard originally for use in encoding speech for satellite distribution to mobile phones. It can be found in use in various telephony products such as voice mail applications.It compresses 160 13-bit samples into 260 bits (or 33 bytes), i.e. 1650 bytes/sec (at 8000 samples/sec). It results in very good compression with good quality output but is very costly in terms of performance.
CCUIT G721 Used for computer telephony. 32 kbit/s adaptive differential pulse code modulation (ADPCM).
Good for keeping of human speech.
CCUIT G723 Used for computer telephony. Extensions of Recommendation G.721 adaptive differential pulse code modulation to 24 and 40 kbit/s for digital circuit multiplication equipment application. Good for keeping of human speech.
CCUIT G723.1 Microsoft CCUIT G.723.1 format (read-only).G.723.1(Originally called TrueSpeech 6.3/5.3) is a member in the TrueSpeech Family of high quality, low bit rate, speech compression algorithms from DSP Group, Inc., it produces digital voice compression levels of 20:1 and 24:1 (6.3 Kbps and 5.3 Kbps). After an extensive series of quality tests and evaluations of various coders, the International Telecommunications Union (ITU) selected TrueSpeech 6.3/5.3 Kbps (G.723.1) as the voice compression standard for the H.324 videoconferencing standard. H.324 standardizes videoconferencing/telephony over public telephone networks, such as the Internet. G.723.1 is also recommended as the low bit rate speech technology for the ITU H.323 audio and video standard which is supported by Microsoft, Intel and hundreds of other companies as the standard for communications on the InternetThis algorithm is applicable for real-time video and teleconferencing applications where reduced bandwidth and very high quality voice is required. Thus, this technology is ideal for Internet video, VOIP (Voice Over Internet Protocol) applications, audio, videoconferencing, VOD (Video On Demand) applications and Internet telephony applications which enables interoperability between telephony applications both on, and off, the Net.

DSP Group offers Integrated Digital Telephony Processors based on TrueSpeech. DSP Group also licenses a G.723.1 algorithm for videoconferencing, computer telephony, Internet, and numerous other multimedia applications.

CCUIT G726 Used for computer telephony. 40, 32, 24, 16 kbit/s adaptive differential pulse code modulation (ADPCM). Good for keeping of human speech.
CCUIT G729 ITU-T recommendation G.729 annex A (referred as G.729A) is the reduced complexity version of G.729 recommendation and operates at 8 Kbps. The performance of this codec may not be as good as the G729 in certain Because of its processing delay (frame size of 10ms), G.729A is well designed to offer telephone quality voice over systems. G.729A provides near toll quality service.
MP2 (MPEG 1 Layer 2 MPEG Layer-2 format. Compression ratio is 1:6…1:8 corresponds to to 256..192 kbps for a stereo signal. The extensions are *.mp2 or *.mpa.
MP3 (MPEG 1/ 2/ 2.5 Layer 3) MPEG Layer-3 format. Very popular format for keeping of music.The mp3 algorithm development started in 1987, with a joint cooperation of Fraunhofer iis-a and the university of erlangen. it is standardized as iso-mpeg audio layer 3. it soon became the de facto standard for lossy audio encoding, due to the high compression rates (1/12 of the original size, still remaining considerable quality), the high availability of decoders and the low cpu requirements for playback. (486 dx2-66 is enough for real-time decoding). it supports multichannel files (although there’s no implementation yet), sampling frequencies from 16khz to 24khz (mpeg2 layer 3) and 32khz to 48khz (mpeg1 layer 3). formal and informal listening tests have shown that mp3 at the 192-256 kbps range provide encoded results undistinguishable from the original materials in most of the cases.mp3 uses the following for compression:

– huffman coding;
– quantization;
– m/s matrixing;
– intensity stereo;
– channel coupling;
– modified discrete cosine transform (mdct);
– polyphase filter bank.Compression ratio is 1:10…1:12 corresponds to 128..112 kbps for a stereo signal. 

MPEG Version 2.5 was added lately to the MPEG 2 standard. It is an extension used for very low bitrate files, allowing the use of lower sampling frequencies. If your decoder does not support this extension, it is recommended for you to use 12 bits for synchronization instead of 11 bits.

MPC (MPEG plus/MusePack) MusePack (.mpc) is a lossy compressed format that is considered to be the best of all the codecs at moderate to high bitrates. At lower bandwidths of 128 Kbps, any benefits over OGG or WMA are less clear. The most significant downside to MPC is that as of today, no hardware devices or portable audio players support the format.MPC is a new space-saving audio format which was formerly known as MPEG Plus (.mp+). Very similar to MPEG Layer 2, but uses subband-based selectable channel coupling, Huffman coding, differential Huffman coding. Typical data rates are between 160 and 200 kbps. MPEGplus encoder uses a frequency range that can reach up to 22KHz. This is because many people can hear sounds above 16KHz even when it is sometimes hard to hear anything but it makes a lot of difference in sound dynamics.The MPEGplus format’s most important technique to reduce the bitrate is the exploitation of psychacoustic effects. The psychacoustic effect is determined by doing sound test and to check which sounds the human ear can hears and which sounds not. This means that when you hear a very hard explosion it is almost impossible to hear a drop of water falling at the same time. This is why the sound of the drop of water is faded out because it’s impossible to hear and so it will not be noticed. When this sound of the drop of water is faded away this preserves the bitrate. The M/S Stereo technique uses the stereo field to compare both channels and when the sound on both channels is the same or almost the same it has to be encoded just once, preserving the bitrate.

it has simple stereo support and is limited to a frequency of 44.100hz, although stream version 8 [sv8] will be able to encode 32/48khz streams, as well as multichannel ones.

informal listening tests have demonstrated that mpc is the best publicly available lossy audio encoder at bitrates higher than 160kbps. being a subband encoder and given their inherint nature to be less efficient than transform coders, it is worse than aac and ogg vorbis in bitrates lower than 160kbps.

it uses for compression:

– mp2 compression technologies, plus;
– subband-based selectable channel coupling;
– huffman coding;
– differential huffman coding;
– vastly improved psymodel;
– non-linear spreading function;
– ans (adaptive noise shaping);
– cvd (clear voice detection);
– temporal masking with variable time constants.

PCM Standard Windows WAV format for non-compressed audio files. Pulse Code Modulation (PCM) is the standard method of digitally encoding audio. It is the basic uncompressed data format used in file types such as Windows .wav.
Quick Time Apple format for the Macintosh, read only. Although QuickTime was developed by Apple for the Macintosh, QuickTime files are the closest thing the Web has to a standard cross-platform movie format (with MPEG a close second). QuickTime movies have the extension .qt or .mov.QuickTime supports many different codecs, particularly CinePak and Indeo, both of which can be used cross-platform.
CCIUT u-Law Compressed WAV format. u-Law (or CCIUTT standard G.711) is an audio compression scheme and international standard in telephony applications. u-Law is very similar to A-Law, a variation of u-Law found in European systems. This encoding format compresses original 16-bit audio down to 8 bits (for a 2:1 compression ratio) with a dynamic range of about 13-bits. Thus, u-Law encoded waveforms have a higher s/n ratio than 8-bit PCM, but at the price of a bit more distortion than the original 16-bit audio. The quality is higher than you would get with 4-bit ADPCM formats. Encoding and decoding is rather fast and generally, widely supported. 
VOX Dialogic ADPCM format. The Dialogic ADPCM format is commonly found in telephony applications, and has been optimized for low sample rate voice. It will only save mono 16-bit audio, and like other ADPCM formats, it compresses to 4-bits/sample (for a 4:1 ratio). This format has no header, so any file format with the extension .VOX will be assumed to be in this format. 
RAW Raw format of audio files. Doesn’t contain header of an audio file.
Ogg Vorbis Ogg Vorbis format. Ogg Vorbis is an audio compression format. It is roughly comparable to other formats used to store and play digital music, such as MP3, VQF, AAC, and other digital audio formats. Ogg Vorbis is a fully open, non-proprietary, patent-and-royalty-free, general-purpose compressed audio format for mid to high quality (8kHz-48.0kHz, 16+ bit, polyphonic) audio and music at fixed and variable bitrates from 16 to 128 kbps/channel.
WAV It is not an audio codec. It is the file format. This format was created by Microsoft and IBM, and it has unfortunately become a popular standard. It specifies an arbitrary sampling rate, number of channels and sample size. It also specifies a number of application-specific blocks within the file. It has a plethora of different compression formats.It is the files with .wav extension. But this files can be converted by different codecs: Microsoft PCM
Microsoft ADPCM
DSP
GSM
VOX
A-law
U-law
CCUIT G723.1
CCUIT G721
CCUIT G723
CCUIT G726
CCUIT G729 (A)
WMA Windows Media Audio format. A special type of advanced streaming format file for use with audio content encoded with the Windows Media Audio codec. The .wma extension indicates a file format and how the content is encoded.


« Previous PageNext Page »