声明变量baijq的HTML5同时

来源:互联网 发布:it招标网 编辑:程序博客网 时间:2024/06/16 02:35

聋子,安排在左右当侍者,可避免泄露重要军事机密;哑巴,派他传递密信,一旦被敌人抓住,除了搜去密信之外,再也问不出更多的HTML5东西;瘸子,命令他去守护炮台,坚守阵地,他很难弃阵而逃;瞎子,听觉特别好,命他战前伏在阵前qie听敌军的动静,担负侦察任务。

例如,intbaijq;baijq=250;//声明变量baijq的HTML5同时,系统给baijq分配了空间。引用类型就不是了,只给变量分配了引用空间,数据空间没有分配,因为谁都不知道数据是什么啊,整数,字符?我们看一个错误的例子:mydatetoday;today day=4;//发生错误,因为today对象的数据空间未分配。

作者: 时间: 出处: 缩略图: 标题:vector用法 (二) 迭代器内容: 迭代器就是一个来回遍历的HTML5指针,这么想就方便理解了。#include&lt;iostream&gt;#include&lt;vector&gt;using namespace std;int main(){vector&lt;int&gt; ivec(5,1);/* iterator 感觉就相当于一个指针* 指针类型根据每一个容器有所不同 * iter接受所有指针操作的方法 * 采用begin、end的赋值方法,可以避免容器为空产生的问题 */vector&lt;int&gt;::iterator iter1 = ivec begin();int i = 1;for(vector&lt;int&gt;::iterator iter = ivec begin(); iter != ivec end(); iter++){*iter = i++;}// 常量迭代器,不能更改指向的值for(vector&lt;int&gt;::const_iterator iter = ivec begin(); iter != ivec end(); iter++){cout&lt;&lt;*iter&lt;&lt;endl;}cout&lt;&lt;ivec[2]&lt;&lt;endl;cout&lt;&lt;*(++iter1)&lt;&lt;endl;return 0;}输出结果:1234532 本篇博客出自 阿修罗道,转载请注明出处:blog csdn net/fansongy/article/details/7284462作者: 时间: 出处: 缩略图: 标题:getting runtime information in weblogic server by wlst 内容: getting runtime informationthis chapter describes how to use weblogic scripting tool (wlst) to retrieve information that weblogic server instances produce to describe their run-time state this chapter includes the following sections:accessing runtime information: main stepsconfiguring loggingworking with the weblogic diagnostics frameworkaccessing runtime information: main stepsthe administration server hosts the domain run-time hierarchy which provides access to any mbean on any server in the weblogic domain  if the administration server is not running for a weblogic domain, wlst can connect to individual managed servers to retrieve run-time data accessing the run-time information for a weblogic domain includes the following main steps:invoke wlst and connect to a running administration server instance  see invoking wlst navigate to the domain run-time mbean hierarchy by entering the domainruntime command wls:/mydomain/serverconfig&gt;domainruntime() the domainruntime command places wlst at the root of the domain-wide run-time management objects,domainruntimembean navigate to serverruntimes and then to the server instance which you are interested in monitoring wls:/mydomain/domainruntime&gt;cd(`serverruntimes/myserver`) at the server instance, navigate to and interrogate run-time mbeans wls:/mydomain/domainruntime/serverruntimes/myserver&gt;cd(`jvmruntime/myserver`)&gt; wls:/mydomain/domainruntime/serverruntimes/myserver/jvmruntime/myserver&gt;ls() -rheapfreecurrent191881368-rheapfreepercent87-rheapsizecurrent259588096-rheapsizemax518979584-rjavavmvendorsun microsystems inc -rjavavendorsun microsystems inc -rjavaversion1 6 0_21-rname adminserver-rosnamewindows xp-rosversion 5 1-rtype jvmruntime-ruptime409141-r-xprederegistervoid :the following sections provide example scripts for retrieving run-time information about weblogic server server instances and weblogic domain resources script for monitoring server statethe wlst online script in example 8-1 navigates the domain run-time hierarchy and checks the status of a managed server every 5 seconds  it restarts the server if the server state changes fromrunning to any other status  it assumes that wlst is connected to the weblogic domain`s administration server example 8-1 monitoring server state# node manager needs to be running to run this script import threadimport timedef checkhealth(servername):while 1:slbean = getslcrt(servername)status = slbean getstate()print `status of managed server is `&#43;statusif status != &quot;running&quot;: print `starting server `&#43;servername start(servername, block=&quot;true&quot;)time sleep(5) def getslcrt(svrname):domainruntime()slrbean = cmo lookupserverlifecycleruntime(svrname)return slrbeancheckhealth(&quot;myserver&quot;)script for monitoring the jvmthe wlst online script in example 8-2 monitors the hjvmheapsize for all running servers in a weblogic domain; it checks the heap size every 3 minutes and prints a warning if the heap size is greater than a specified threshold  it assumes that the url for the weblogic domain`s administration server is t3://localhost:7001 for information on how to run this script, see invoking wlst example 8-2 monitoring the jvm heap sizewaittime=180000threshold=300000000uname = &quot;weblogic&quot;pwd = &quot;welcome1&quot;url = &quot;t3://localhost:7001&quot;def monitorjvmheapsize():connect(uname, pwd, url)while 1:servernames = getrunningservernames()domainruntime()for name in servernames:print `now checking `&#43;name getname()try:cd(&quot;/serverruntimes/&quot;&#43;name getname()&#43;&quot;/jvmruntime/&quot;&#43;name getname())heapsize = cmo getheapsizecurrent()if heapsize &gt; threshold:# do whatever is neccessary, send alerts, send email etc print `warning: the heapsize is greater than the threshold`else: print heapsizeexcept wlstexception,e:# this typically means the server is not active, just ignore# pass print &quot;ignoring exception &quot; &#43; e getmessage()java lang thread sleep(waittime) def getrunningservernames():# only returns the currently running servers in the domainreturn domainruntimeservice getserverruntimes() if __name__== &quot;main&quot;:monitorjvmheapsize()configuring loggingusing wlst, you can configure a server instance`s logging and message output to determine which log attributes can be configured, see &quot;logmbean&quot; and &quot;logfilembean&quot; in the oracle weblogic server mbean reference  the reference also indicates valid values for each attribute the wlst online script in example 8-3 sets attributes of logmbean (which extends logfilembean)  for information on how to run this script, seeinvoking wlst example 8-3 configuring logging# connect to the serverconnect(&quot;weblogic&quot;,&quot;welcome1&quot;,&quot;t3://localhost:7001&quot;)edit()startedit()# set cmo to the server log configcd(&quot;servers/myserver/log/myserver&quot;)ls ()# change logmbean attributesset(&quot;filecount&quot;, 5)set(&quot;fileminsize&quot;, 400)# list the current directory to confirm the new attribute valuesls ()# save and activate the changessave()activate()# all doneexit()working with the weblogic diagnostics frameworkthe weblogic diagnostic framework (wldf) is a monitoring and diagnostic framework that can collect diagnostic data that servers and applications generate  you configure wldf to collect the data and store it in various sources, including log records, data events, and harvested metrics  for more information, see configuring and using the diagnostics framework for oracle weblogic server for example scripts that demonstrate using wlst to configure the weblogic diagnostic framework, see&quot;weblogic scripting tool examples&quot; in configuring and using the diagnostics framework for oracle weblogic server to view the collected diagnostics information using wlst, use one of the following commands to export the data from the wldf repositories:from wlst offline, use the exportdiagnosticdata command (see &quot;exportdiagnosticdata&quot; in weblogic scripting tool command reference) from wlst online, use the exportdiagnosticdatafromserver command (see&quot;exportdiagnosticdatafromserver&quot; in weblogic scripting tool command reference)) weblogic management runtimeinterface domainruntimembeanpublic interface domainruntimembeanthis class is used for monitoring a weblogic domain  a domain may contain zero or more clusters  a cluster may be looked up by a logical name deprecation of mbeanhome and type-safe interfacesthis is a type-safe interface for a weblogic server mbean, which you can import into your client classes and access throughweblogic management mbeanhome  as of 9 0, the mbeanhome interface and all type-safe interfaces for weblogic server mbeans are deprecated  instead, client classes that interact with weblogic server mbeans should use standard jmx design patterns in which clients use the javax management mbeanserverconnection interface to discover mbeans, attributes, and attribute types at runtime method summarydategetactivationtime()the time when the domain became active appruntimestateruntimembeangetappruntimestateruntime()returns a service from which it is possible to determine the state applications throughout the domain coherenceserverlifecycleruntimembean[]getcoherenceserverlifecycleruntimes()the coherenceserverlifecycleruntimembean for all configured coherence servers in the domain consoleruntimembeangetconsoleruntime()return the mbean which provides access to console runtime services deployerruntimembeangetdeployerruntime()deprecated 9 0 0 0deploymentmanagermbeangetdeploymentmanager()provides access to the service interface to the interface that is used to deploy new customer applications or modules into this domain logruntimembeangetlogruntime()return the mbean which provides access to the control interface for wls server logging messagedrivencontrolejbruntimembeangetmessagedrivencontrolejbruntime()the messagedrivencontrolejbruntimembean for this server migratableservicecoordinatorruntimembeangetmigratableservicecoordinatorruntime()returns the service used for coordinating the migraiton of migratable services migrationdataruntimembean[]getmigrationdataruntimes()returns a history of server migrations wseepolicysubjectmanagerruntimembeangetpolicysubjectmanagerruntime()serverlifecycleruntimembean[]getserverlifecycleruntimes()the serverlifecycleruntimembean for all configured servers in the domain servicemigrationdataruntimembean[]getservicemigrationdataruntimes()returns all the service migrations done in the domainsnmpagentruntimembeangetsnmpagentruntime()return the mbean which provides access to the monitoring statistics for wls snmp agent coherenceserverlifecycleruntimembeanlookupcoherenceserverlifecycleruntime(stringname)returns the coherence server life cycle run-time mbean for the specified server serverlifecycleruntimembeanlookupserverlifecycleruntime(stringname)returns the server life cycle run-time mbean for the specified server voidrestartsystemresource(systemresourcembeanresource)restarts a system resource on all nodes to which it is deployed voidsetpolicysubjectmanagerruntime(wseepolicysubjectmanagerruntimembeanbean)作者: 时间: 出处: 缩略图: 标题:<font color="red">[置顶]</font>千万别惹程序员内容: 好久没有发娱乐性质的技术文章了,搞得气氛有点严肃了,考虑到程序员们都是比较严肃和容易较真的类书呆子的群体,所以,需要更新一个有娱乐性质的文章了。

原创粉丝点击