2011年9月13日

          Haddop 配置引起的
          WARN org.mortbay.log: /getimage: java.io.IOException: GetImage failed. java.io.IOException: Content-Length header is not provided by  the namenode when trying to fetch http://127.0.1.1:50090/getimage?getimage=1

          最近在翻看NameNode的log時發現經常有這一段信息出現:



          看來是SecondNameNode在向NameNode獲取Image時出的問題。雖然不影響hdfs使用,但是SecondName
          備份功能失效,任其下去萬一NameNode掛了那可就無處申冤了。
          經過Google大神幫助,得知需要在hdfs-site.xml中手動配置dfs.secondary.http.address,這個配置項的默認值如下
          <property>
            
          <name>dfs.namenode.secondary.http-address</name>
            
          <value>0.0.0.0:50090</value>
            
          <description>
              The secondary namenode http server address and port.
              If the port is 
          0 then the server will start on a free port.
            
          </description>
          </property>
          需要明確指明SecondName,與conf/master里面的名稱一樣
          <property>
            
          <name>dfs.namenode.secondary.http-address</name>
            
          <value>test-dn2:50090</value>
            
          <description>
              The secondary namenode http server address and port.
              If the port is 
          0 then the server will start on a free port.
            
          </description>
          </property>
          posted @ 2011-09-13 11:44 Juliashine 閱讀(888) | 評論 (1)編輯 收藏

          2007年3月29日

          1、IE有全局event對象window.event,FF沒有,FF中的?event?只能在事件發生的現場使用,即必須通過事件綁定函數的參數來使用。
          <input?type="text"?name="input_content"?onkeydown="exeCode(event)"/>

          <script?language="javascript">
          function?exeCode()?{
          ??
          //取得事件對象
          ??var?event?=?arguments[0]?||?window.event;
          ??
          //取得事件的發生源對象
          ??var?element?=?event.srcElement?||?event.target;
          }

          </script>


          2、FireFox下沒有preserveWhiteSpace這個屬性,即:把空白也當作一個節點。而IE則默認為false,即把空白不看成一個節點。所以在FireFox下previousSibling可能是空白節點,除非兩個HTML標簽之間沒有任何形式的空格。

          3、IE下可以用document.frames("name").document的方式取得frame中所嵌頁面的document對象,FF下卻會得到null,解決的的辦法是document.getElementById(framename).contentWindow.document,也可以使用
          window.frames[frameName].document 直接獲取frame里的document對象


          最后推薦一篇文章:Javascript的IE和Firefox兼容性匯編
          posted @ 2007-03-29 15:06 Juliashine 閱讀(752) | 評論 (0)編輯 收藏

          2006年12月21日

          在Hibernate中配置Proxool連接池
          1:在applicationContext.xml中配置SessionFactory
          <bean?id="sessionfactory"?class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
          ????<property?name="hibernateProperties">
          ????????<props>
          ????????????<prop?key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
          ????????????<prop?key="hibernate.show_sql">true</prop>
          ????????????<!--指定Proxool配置文件-->
          ????????????<prop?key="hibernate.proxool.properties">conf/proxool.properties</prop>
          ????????????<!--<prop?key="hibernate.proxool.xml">conf/proxool.xml</prop>-->
          ????????????<!--指定Proxool的alias,必須與Proxool的配置文件中的alias一致-->
          ????????????<prop?key="hibernate.proxool.pool_alias">hibernate-oracle</prop>
          ????????</props>
          ????</property>
          </bean>
          2:配置Proxool(conf/proxool.properties)
          #jdbc-0.proxool.alias=mysql
          #jdbc-0.proxool.driver-class=org.gjt.mm.mysql.Driver
          #jdbc-0.proxool.driver-url=jdbc:mysql://localhost:3306/contestdb?user=root&password=1234&useUnicode=true&characterEncoding=utf8
          #jdbc-0.user=root
          #jdbc-0.password=1234

          jdbc-0.proxool.alias=hibernatea-oracle
          jdbc-0.proxool.driver-class=oracle.jdbc.driver.OracleDriver
          jdbc-0.proxool.driver-url=jdbc:oracle:thin:@172.16.2.6:1521:dbname
          jdbc-0.user=username
          jdbc-0.password=username
          jdbc-0.proxool.maximum-connection-count=20
          jdbc-0.proxool.house-keeping-test-sql=SELECT?SYSDATE?FROM?DUAL;
          #DEBUG,?INFO,?WARN,?ERROR,?FATAL.
          jdbc-0.proxool.statistics-log-level=ERROR
          posted @ 2006-12-21 15:13 Juliashine 閱讀(430) | 評論 (0)編輯 收藏
           
          ???????? The?URL?extension?to?use?to?determine?if?the?request?is?meant?for?a?Struts?action?
          ???????????用URL擴展名來確定是否這個請求是被用作Struts?action,其實也就是設置?action的后綴,例如login.do的'do'字。

          struts.configuration
          ??????????The?org.apache.struts2.config.Configuration?implementation?class
          ????????????org.apache.struts2.config.Configuration接口名

          struts.configuration.files
          ??????????A?list?of?configuration?files?automatically?loaded?by?Struts?
          ???????????struts自動加載的一個配置文件列表

          struts.configuration.xml.reload
          ??????????Whether?to?reload?the?XML?configuration?or?not
          ???????????是否加載xml配置(true,false)

          struts.continuations.package
          ???????????The?package?containing?actions?that?use?Rife?continuations
          ???????????含有actions的完整連續的package名稱

          struts.custom.i18n.resources
          ??????????Location?of?additional?localization?properties?files?to?load?
          ???????????加載附加的國際化屬性文件(不包含.properties后綴)

          struts.custom.properties
          ??????????Location?of?additional?configuration?properties?files?to?load
          ???????????加載附加的配置文件的位置


          struts.devMode
          ??????????Whether?Struts?is?in?development?mode?or?not
          ???????????是否為struts開發模式

          struts.dispatcher.parametersWorkaround
          ??????????Whether?to?use?a?Servlet?request?parameter?workaround?necessary?for?some?versions?of?WebLogic
          ????????????(某些版本的weblogic專用)是否使用一個servlet請求參數工作區(PARAMETERSWORKAROUND)

          struts.enable.DynamicMethodInvocation
          ??????????Allows?one?to?disable?dynamic?method?invocation?from?the?URL
          ????????????允許動態方法調用

          struts.freemarker.manager.classname
          ??????????The?org.apache.struts2.views.freemarker.FreemarkerManager?implementation?class?
          ???????????org.apache.struts2.views.freemarker.FreemarkerManager接口名

          struts.i18n.encoding
          ??????????The?encoding?to?use?for?localization?messages
          ???????????國際化信息內碼

          struts.i18n.reload
          ??????????Whether?the?localization?messages?should?automatically?be?reloaded
          ???????????是否國際化信息自動加載?

          struts.locale
          ??????????The?default?locale?for?the?Struts?application
          ???????????默認的國際化地區信息

          struts.mapper.class
          ??????????The?org.apache.struts2.dispatcher.mapper.ActionMapper?implementation?class
          ????????????org.apache.struts2.dispatcher.mapper.ActionMapper接口

          struts.multipart.maxSize
          ??????????The?maximize?size?of?a?multipart?request?(file?upload)
          ???????????multipart請求信息的最大尺寸(文件上傳用)?

          struts.multipart.parser
          ??????????The?org.apache.struts2.dispatcher.multipart.
          ??????????MultiPartRequest?parser?implementation?for?a?multipart?request?(file?upload)?
          ??????????專為multipart請求信息使用的org.apache.struts2.dispatcher.multipart.MultiPartRequest解析器接口(文件上傳用)


          struts.multipart.saveDir
          ??????????The?directory?to?use?for?storing?uploaded?files?
          ???????????設置存儲上傳文件的目錄夾

          struts.objectFactory
          ??????????The?com.opensymphony.xwork2.ObjectFactory?implementation?class
          ???????????com.opensymphony.xwork2.ObjectFactory接口(spring)

          struts.objectFactory.spring.autoWire
          ??????????Whether?Spring?should?autoWire?or?not
          ???????????是否自動綁定Spring

          struts.objectFactory.spring.useClassCache
          ??????????Whether?Spring?should?use?its?class?cache?or?not
          ???????????是否spring應該使用自身的cache?

          struts.objectTypeDeterminer
          ??????????The?com.opensymphony.xwork2.util.ObjectTypeDeterminer?implementation?class
          ????????????com.opensymphony.xwork2.util.ObjectTypeDeterminer接口

          struts.serve.static.browserCache
          ??If?static?content?served?by?the?Struts?filter?should?set?browser?caching?header?properties?or?not?
          ???????????是否struts過濾器中提供的靜態內容應該被瀏覽器緩存在頭部屬性中

          struts.serve.static
          ??????????Whether?the?Struts?filter?should?serve?static?content?or?not?
          ???????????是否struts過濾器應該提供靜態內容

          struts.tag.altSyntax
          ??????????Whether?to?use?the?alterative?syntax?for?the?tags?or?not?
          ???????????是否可以用替代的語法替代tags

          struts.ui.templateDir
          ??????????The?directory?containing?UI?templates
          ???????????UI?templates的目錄夾?

          struts.ui.theme
          ??????????The?default?UI?template?theme
          ???????????默認的UI?template主題

          struts.url.http.port
          ??????????The?HTTP?port?used?by?Struts?URLs
          ???????????設置http端口

          struts.url.https.port
          ??????????The?HTTPS?port?used?by?Struts?URLs?
          ???????????設置https端口

          struts.url.includeParams
          ??????????The?default?includeParams?method?to?generate?Struts?URLs?
          ??????????在url中產生?默認的includeParams


          struts.velocity.configfile
          ??????????The?Velocity?configuration?file?path
          ???????????velocity配置文件路徑

          struts.velocity.contexts
          ??????????List?of?Velocity?context?names
          ???????????velocity的context列表


          struts.velocity.manager.classname
          ??????????org.apache.struts2.views.velocity.VelocityManager?implementation?class
          ???????????org.apache.struts2.views.velocity.VelocityManager接口名

          struts.velocity.toolboxlocation
          ??????????The?location?of?the?Velocity?toolbox
          ???????????velocity工具盒的位置?
          struts.xslt.nocache
          ??????????Whether?or?not?XSLT?templates?should?not?be?cached
          ???????????是否XSLT模版應該被緩存
          posted @ 2006-12-21 15:11 Juliashine 閱讀(552) | 評論 (0)編輯 收藏

          2006年12月15日

          Struts2 發布已經很長時間了,一直沒有顧得上學習,本周工作比較輕松,花點時間照著例子做了一下,但是在與Spring 集成的時候出現問題,action找不到Spring中定義的bean,折騰了兩個多小時才最終搞定,決定把心得記錄下來。

          Struts2 集成 Spring 的 Web.xml 最簡配置

          <? xml?version="1.0"?encoding="UTF-8" ?>
          < web-app? id ="WebApp_9" ?version ="2.4" ?xmlns ="http://java.sun.com/xml/ns/j2ee" ?
          ????xmlns:xsi
          ="http://www.w3.org/2001/XMLSchema-instance"
          ?
          ????xsi:schemaLocation
          ="http://java.sun.com/xml/ns/j2ee?http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >


          ????
          < display-name > Struts?2.0 </ display-name >
          ????
          ????
          < filter >
          ????????
          < filter-name > struts </ filter-name > ????????
          ????????
          < filter-class > org.apache.struts2.dispatcher.FilterDispatcher </ filter-class >

          ????
          </ filter >
          ????
          < filter-mapping >
          ????????
          < filter-name > struts </ filter-name >
          ????????
          < url-pattern > /* </ url-pattern >
          ????
          </ filter-mapping >
          ????
          ????
          < listener >
          ????????
          < listener-class >
          ????????????org.springframework.web.context.ContextLoaderListener
          ????????
          </ listener-class >
          ????
          </ listener >
          ????
          ????
          < welcome-file-list >
          ????????
          < welcome-file > index.html </ welcome-file >
          ????
          </ welcome-file-list >
          </ web-app >

          此配置適用于將Spring 的配置文件放在與Web.xml同一目錄,即WEB-INF目錄下,且配置文件采用默認命名applicationContext.xml,如果Spring配置文件沒有放在WEB-INF下或者采用了自定義名稱,則Web.xml應該如下定義:

          <? xml?version="1.0"?encoding="UTF-8" ?>
          < web-app? id ="WebApp_9" ?version ="2.4" ?xmlns ="http://java.sun.com/xml/ns/j2ee" ?
          ????xmlns:xsi
          ="http://www.w3.org/2001/XMLSchema-instance"
          ?
          ????xsi:schemaLocation
          ="http://java.sun.com/xml/ns/j2ee?http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >


          ????
          < context-param >
          ????????
          < param-name > contextConfigLocation </ param-name >
          ????????
          < param-value > classpath*:applicationContext*.xml </ param-value >
          ????
          </ context-param >
          ????
          < filter >
          ????????
          < filter-name > struts </ filter-name > ????????
          ????????
          < filter-class > org.apache.struts2.dispatcher.FilterDispatcher </ filter-class >

          ????
          </ filter >
          ????
          < filter-mapping >
          ????????
          < filter-name > struts </ filter-name >
          ????????
          < url-pattern > /* </ url-pattern >
          ????
          </ filter-mapping >
          ????
          ????
          < listener >
          ????????
          < listener-class >
          ????????????org.springframework.web.context.ContextLoaderListener
          ????????
          </ listener-class >
          ????
          </ listener >
          ????
          ????
          < welcome-file-list >
          ????????
          < welcome-file > index.html </ welcome-file >
          ????
          </ welcome-file-list >
          </ web-app >

          注意這里比上個配置多出的項

          ???< context-param >
          ??????< param-name > contextConfigLocation </ param-name >
          ??????< param-value > classpath*:applicationContext*.xml </ param-value >
          ???</ context-param >

          表示Spring配置文件放在CLASSPATH目錄下,即WEB-INF/classes目錄下,名稱為applicationContext*.xml,其中“*”為任意字符

          注意,這還沒完,CLASSPATH下有個struts.property文件,必須在里面添加一行內容:
          (我就是缺了這個導致action找不到bean)

          struts.objectFactory?=?spring??

          給Spring配置文件的<beans>元素加上如下屬性

          <beans?default-autowire="autodetect">???

          ??……?……

          OK,配置完畢!可以使用了

          posted @ 2006-12-15 17:04 Juliashine 閱讀(433) | 評論 (0)編輯 收藏

          2006年12月12日

          ROC曲線(Receiver Operating Characteeristic Curve)是顯示Classification模型真正率和假正率之間折中的一種圖形化方法。

          解讀ROC圖的一些概念定義::

          真正(True Positive , TP)被模型預測為正的正樣本
          假負(False Negative , FN)被模型預測為負的正樣本
          假正(False Positive , FP)被模型預測為正的負樣本
          真負(True Negative , TN)被模型預測為負的負樣本

          真正率(True Positive Rate , TPR)或靈敏度(sensitivity)?
          ???TPR = TP /(TP + FN)?
          ???正樣本預測結果數 / 正樣本實際數
          假負率(False Negative Rate , FNR)?
          ???FNR = FN /(TP + FN)?
          ???被預測為負的正樣本結果數 / 正樣本實際數
          假正率(False Positive Rate , FPR)?
          ???FPR = FP /(FP + TN)?
          ???被預測為正的負樣本結果數 /負樣本實際數
          真負率(True Negative Rate , TNR)或特指度(specificity)?
          ???TNR = TN /(TN + FP)?
          ???負樣本預測結果數 / 負樣本實際數

          目標屬性的被選中的那個期望值稱作是“正”(positive)

          ROC曲線上幾個關鍵點的解釋:

          ( TPR=0,FPR=0 ) 把每個實例都預測為負類的模型
          ( TPR=1,FPR=1 ) 把每個實例都預測為正類的模型
          ( TPR=1,FPR=0 ) 理想模型

          此處圖像以后再補

          一個好的分類模型應該盡可能靠近圖形的左上角,而一個隨機猜測模型應位于連接點(TPR=0,FPR=0)和(TPR=1,FPR=1)的主對角線上。

          ROC曲線下方的面積(AUC)提供了評價模型平均性能的另一種方法。如果模型是完美的,那么它的AUG = 1,如果模型是個簡單的隨機猜測模型,那么它的AUG = 0.5,如果一個模型好于另一個,則它的曲線下方面積相對較大。

          Oracle 論壇上對ROC 的解釋
          http://forums.oracle.com/forums/thread.jspa?threadID=415870&tstart=15
          posted @ 2006-12-12 14:25 Juliashine 閱讀(1843) | 評論 (0)編輯 收藏
          僅列出標題  
           
          主站蜘蛛池模板: 千阳县| 宣城市| 丁青县| 长阳| 洛扎县| 宿州市| 嵊泗县| 广安市| 五常市| 孟津县| 邵阳县| 兴仁县| 锦屏县| 赫章县| 修文县| 连城县| 邳州市| 青海省| 景泰县| 安岳县| 连平县| 大石桥市| 图们市| 和静县| 邹平县| 丰宁| 高邮市| 利川市| 沙湾县| 乳山市| 宜宾市| 岚皋县| 北安市| 上犹县| 南雄市| 重庆市| 博罗县| 万载县| 平顶山市| 中江县| 云浮市|