Thursday, June 23, 2011

Cable Network terms

DTV:digital TV
L2VPN:layer 2 vpn
L3VPN:layer 3 vpn
SIP: session Initiation Protocol
IMS: IP Multimedia subsystem
PCMM:Packet Cable Multimedia
WiMAX: Worldwide interoperability for Microwave Access
PON:Passive Optical nework
HFC:Hybrid Fiber-Coax
MSO:multi system operator
I-CMTS:integrated Cable Modem Termination Sys
M-CMTS: Modular Cable Modem termination system
NSI:network side interface
PHY:Physical layer
ERMI:Edge resource management interface
CM: Cable modem
DOCSIS: Data over Cable Service Interface Specification
edge-eqam:edge quadrature amplitude modulation
SPA:shared port adapter
PRE4:performance routing engine 4
DTCC: DOCSIS Timing communication and Control
SIP:SPA Interface Processor
DTI:DOCSIS Timing Interface
PEM:Power Entry Module
RF:radio frequenct
US:up stream
DS:down stream
GE:gigabit ethernet
LC:line card

beautify sqlplus output

when runing following code in sql plus,we get a very messay output because of column data type and it's width;
--var rc refcursor
--exec tmp_pkg.get_cmts_bychassis_cursor(14,:rc)
--print rc

here is the output:
CMTS_SEQ
----------
CMTS_NAME
--------------------------------------------------------------------------------
CHASSIS_SEQ
-----------
CHASSIS_NAME
--------------------------------------------------------------------------------
CMTS_TYPE_NAME
--------------------------------------------------------------------------------
MODEL
--------------------------------------------------------------------------------
14

CMTS_SEQ
----------
CMTS_NAME
--------------------------------------------------------------------------------
CHASSIS_SEQ
-----------
CHASSIS_NAME
--------------------------------------------------------------------------------
CMTS_TYPE_NAME
--------------------------------------------------------------------------------
MODEL
--------------------------------------------------------------------------------
cmts11.nmkt

CMTS_SEQ
----------
CMTS_NAME
--------------------------------------------------------------------------------
CHASSIS_SEQ
-----------
CHASSIS_NAME
--------------------------------------------------------------------------------
CMTS_TYPE_NAME
--------------------------------------------------------------------------------
MODEL
--------------------------------------------------------------------------------
14

CMTS_SEQ
----------
CMTS_NAME
--------------------------------------------------------------------------------
CHASSIS_SEQ
-----------
CHASSIS_NAME
--------------------------------------------------------------------------------
CMTS_TYPE_NAME
--------------------------------------------------------------------------------
MODEL
--------------------------------------------------------------------------------
cmts11.nmkt

CMTS_SEQ
----------
CMTS_NAME
--------------------------------------------------------------------------------
CHASSIS_SEQ
-----------
CHASSIS_NAME
--------------------------------------------------------------------------------
CMTS_TYPE_NAME
--------------------------------------------------------------------------------
MODEL
--------------------------------------------------------------------------------
i-cmts

CMTS_SEQ
----------
CMTS_NAME
--------------------------------------------------------------------------------
CHASSIS_SEQ
-----------
CHASSIS_NAME
--------------------------------------------------------------------------------
CMTS_TYPE_NAME
--------------------------------------------------------------------------------
MODEL
--------------------------------------------------------------------------------
ubr10012

CMTS_SEQ
----------
CMTS_NAME
--------------------------------------------------------------------------------
CHASSIS_SEQ
-----------
CHASSIS_NAME
--------------------------------------------------------------------------------
CMTS_TYPE_NAME
--------------------------------------------------------------------------------
MODEL
--------------------------------------------------------------------------------
we need make it tide and neat:
first format those columns that are too long
column CMTS_SEQ format 999
column CMTS_NAME format a12
...
then rerun the code and print cursor
we will get follwing output

SQL> print rc

CMTS_SEQ CMTS_NAME CHASSIS_SEQ CHASSIS_NAME CMTS_TYPE_NAME MODEL
-------- ------------ ----------- ------------ ------------ ------------
14 cmts11.nmkt 14 cmts11.nmkt i-cmts ubr10012

cheers!

limited resultset in oracle sql statement

select * form dtt_cmts where rownum <20;

call storeprocedure from sqlplus

var rc refcursor
exec tmp_pkg.get_cmts_by_chasses_corsor(14,:rc)
print rc
note:there are not semicolon(;) at end os statement
14 is input parameter,rc is output parameter as a cursor

rlwrap help sqlplus to use up arrow key

download rlwrap
./configure
make
make install(maybe need sudo)
then run sqlplus like this:
rlwrap sqlplus user/pw@tnsname

connect to Oracle Db by sqlplus in linux

1) find tnsnames.ora
2) add or changes a entry like this
ORCLDBDTT =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ip address )(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SID = STGSPDB)
)
)
note: ORCLDBDTT is a name call tns name,STGSPDB is a service ID
3)save the file connect to db by this:
sqlplus user/password@ORCLDBDTT

TNS stand for

TNS stands for Transparent Network Substrate

Thursday, June 16, 2011

JSF2 and javascript

<h:outputScript library="js" name="common.js" />

this will create

<script type="text/javascript" 
src="/JavaServerFaces/faces/javax.faces.resource/common.js?ln=js"
></script>

common.js file should be reside in resources/js folder

this is from MKYong's blog

Wednesday, June 15, 2011

include local javascript file in ee6 web app for jsp pages

include following code in head or body

<script type="text/javascript" src="http://localhost:8080/JavaEE6Webinar/faces/javax.faces.resource/javascript.js"></script>

YUI library loading code creation url

http://developer.yahoo.com/yui/articles/hosting/

xhtml file include js files in ee6

inside h:head include following tags
< h:outputScript name="javascript.js" target="head"> < /h:outputScript>
javascript.js should be inside resources folder,this will be load by javax.faces.resource

when load css file,it should go like this
< h:outputStylesheet name="css/jsfcrud.css"/>
jsfcrud.css file be inside resource/css folder


this piece of code can be put anywhere that use target to put script tag in head or body.

Monday, June 13, 2011

install XML Tool in netbean 7

get update plugin from here:http://deadlock.netbeans.org/hudson/job/xml/lastSuccessfulBuild/artifact/build/updates/updates.xml

Friday, June 3, 2011

linux file find method

SEARCH FILE HAS SPECIAL NAME AND SIZE ETC
find -name 'mypage.htm'

In the above command the system would search for any file named mypage.htm in the current directory and any subdirectory.

find / -name 'mypage.htm'

In the above example the system would search for any file named mypage.htm on the root and all subdirectories from the root.

find -name 'file*'

In the above example the system would search for any file beginning with file in the current directory and any subdirectory.

find -name '*' -size +1000k

In the above example the system would search for any file that is larger then 1000k.

find . -size +500000 -print

Next, similar to the above example, just formatted differently this command would find anything above 500MB.

---------------------------------------------------------------------------------------------
SEARCH FILE CONTAIN STRING
Task: Search all subdirectories recursively

You can search for a text string all files under each directory, recursively with -roption:
$ grep -r "redeem reward" /home/tom
Task: Only print filenames

By default, grep command prints the matching lines You can pass -H option to print the filename for each match.
$ grep -H -r “redeem reward” /home/tom