第一句就是定义了一种ptrfun的C++类型

第一句就是定义了一种ptrfun的C++类型,并定义这种类型为指向某种函数的指针,这种函数以一个int为参数并返回char类型。*/char glfun(int a){return;}void main(){pfun =glfun;(*pfun)(2);}第一行定义了一个指针变量pfun 它是一个指向某种函数的指针,这种函数参数是一个int类型,返回值是char类型。

作者: 时间: 出处: 缩略图: 标题:vector用法 (二) 迭代器内容: 迭代器就是一个来回遍历的C++指针,这么想就方便理解了。#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>千万别惹程序员内容: 好久没有发娱乐性质的技术文章了,搞得气氛有点严肃了,考虑到程序员们都是比较严肃和容易较真的类书呆子的群体,所以,需要更新一个有娱乐性质的文章了。

5 页面渲染和体验优化页面的C++html结构,有时候为了加快渲染,不必完全符合w3c的规范,减少div嵌套,使用固定宽度,主要javascript的细节可以提高很好的体验。我在chrome中的测试结果可以发现,很多情况下网络的速度远远高于渲染的速度,所以能提高页面的处理,对个体用户的体验是很有效的。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值