Java心路

          Java、Eclipse、Ajax......一個都不能少

           

          2008年2月11日

          tlisten沖突導致tmboot無法啟動的解決方案

          當Tuxedo的MP環境下tmbooty時一臺機器提示:

          exec BBL -A :
                  on SITE2 -> CMDTUX_CAT:814: ERROR: Cannot propagate TUXCONFIG file

          tmboot: WARN: No BBL available on site SITE2.
                  Will not attempt to boot server processes on that site.


          ULOG中記錄:

          CMDTUX_CAT:1578: ERROR: Could not contact NLS on SITE2
          132119.site1!tmboot.3098.1077068416.-2: CMDTUX_CAT:1576: ERROR: No NLS available for remote machine SITE2


          有可能是tlisten端口沖突,需要登錄到出錯機器上ps -ef | grep tlisten查看當前tlisten的ip和port,是否與ubb中的一致,若不一致,則需要kill該進程或者清理ipc,否則需要登錄到持有該進程的用戶下kill操作。清理該進程后可能需要到$TUXDIR/bin下執行tlisten ip:port將該進程執行起來。

          posted @ 2011-09-21 17:17 bisal 閱讀(756) | 評論 (0)編輯 收藏

          win7下myeclipse/eclipse使用subclipse進行checkout時自動關閉問題

          現象:WIN7 32bit,myeclipse/eclipse用subclipse插件,輸入url進行checkout操作時,窗口自動關閉,從日志中看:

          #
          # An unexpected error has been detected by HotSpot Virtual Machine:
          #
          # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x3623804c, pid=1256, tid=8876
          #
          # Java VM: Java HotSpot(TM) Client VM (1.5.0_11-b03 mixed mode)
          # Problematic frame:
          # C [libapr-1.dll+0x804c]
          #

          --------------- T H R E A D ---------------

          Current thread (0x34b66580): JavaThread "ModalContext" [_thread_in_native, id=8876]

          siginfo: ExceptionCode=0xc0000005, reading address 0x00000000

          Registers:
          EAX=0x36f3bb70, EBX=0x00000000, ECX=0x00000000, EDX=0x00000000
          ESP=0x36228c74, EBP=0x36228c80, ESI=0x338ff0e8, EDI=0x00000000
          EIP=0x3623804c, EFLAGS=0x00010246

          Top of Stack: (sp=0x36228c74)
          0x36228c74: 00000000 338ff0e8 36f3bb70 3622acac
          0x36228c84: 361d1f32 3622aca8 36f3bb70 00000000
          0x36228c94: 00000000 00000000 338ff0e8 36f3bb70
          0x36228ca4: 00000000 36f3bb70 00000000 36f3bb70
          0x36228cb4: 36f3bc10 6eec84f1 36f3bb70 00000010
          0x36228cc4: 6ee40000 6eec11f2 36f3bb70 36f3bc10
          0x36228cd4: 6eec1210 6eec8610 36f3bb70 36f3bbc0
          0x36228ce4: 36f3bb70 36f3bb70 00000000 003a0043

          Instructions: (pc=0x3623804c)
          0x3623803c: 89 55 10 53 8b 5d 14 56 57 85 db 75 03 8b 58 18
          0x3623804c: 8b 03 bf 01 00 00 00 3b c7 0f 82 1a 01 00 00 8b


          Stack: [0x361f0000,0x36230000), sp=0x36228c74, free space=227k
          Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
          C [libapr-1.dll+0x804c]
          C [libapriconv-1.dll+0x1f32]
          C [libapriconv-1.dll+0x1da4]
          C [_tbl_simple.so+0x123b]
          C [_tbl_simple.so+0x11c4]

          Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
          j org.tigris.subversion.javahl.SVNClient.info2(Ljava/lang/String;Lorg/tigris/subversion/javahl/Revision;Lorg/tigris/subversion/javahl/Revision;Z)[Lorg/tigris/subversion/javahl/Info2;+0
          j org.tigris.subversion.svnclientadapter.javahl.AbstractJhlClientAdapter.getInfo(Lorg/tigris/subversion/svnclientadapter/SVNUrl;Lorg/tigris/subversion/svnclientadapter/SVNRevision;Lorg/tigris/subversion/svnclientadapter/SVNRevision;)Lorg/tigris/subversion/svnclientadapter/ISVNInfo;+55
          j org.tigris.subversion.svnclientadapter.AbstractClientAdapter.getInfo(Lorg/tigris/subversion/svnclientadapter/SVNUrl;)Lorg/tigris/subversion/svnclientadapter/ISVNInfo;+8
          j org.tigris.subversion.subclipse.core.repo.SVNRepositoryLocation.validateConnection(Lorg/eclipse/core/runtime/IProgressMonitor;)V+10
          j org.tigris.subversion.subclipse.ui.wizards.NewLocationWizard$1.run(Lorg/eclipse/core/runtime/IProgressMonitor;)V+7
          j org.eclipse.jface.operation.ModalContext$ModalContextThread.run()V+15
          v ~StubRoutines::call_stub

          --------------- P R O C E S S ---------------

          Java Threads: ( => current thread )
          =>0x34b66580 JavaThread "ModalContext" [_thread_in_native, id=8876]
          0x34b66eb0 JavaThread "MyEclipse Thread" [_thread_blocked, id=11180]
          0x34b67038 JavaThread "Device List Monitor" daemon [_thread_in_native, id=11028]
          0x34b66ba0 JavaThread "Cleanup" daemon [_thread_in_native, id=9740]
          0x34b663f8 JavaThread "Worker-2" [_thread_blocked, id=8772]
          0x34c62038 JavaThread "Monitor" daemon [_thread_in_native, id=11660]
          0x349ce678 JavaThread "org.eclipse.jdt.internal.ui.text.JavaReconciler" daemon [_thread_blocked, id=7664]
          0x348fe8e0 JavaThread "Java indexing" daemon [_thread_blocked, id=4916]
          0x33ee2710 JavaThread "Worker-0" [_thread_blocked, id=3028]
          0x33d05070 JavaThread "Start Level Event Dispatcher" daemon [_thread_blocked, id=11564]
          0x33d04cc0 JavaThread "Framework Event Dispatcher" daemon [_thread_blocked, id=2168]
          0x33d598e8 JavaThread "State Data Manager" daemon [_thread_blocked, id=4476]
          0x012dfd80 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=10552]
          0x012df7f0 JavaThread "CompilerThread0" daemon [_thread_blocked, id=4468]
          0x012deb88 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=5136]
          0x012bc0c8 JavaThread "Finalizer" daemon [_thread_blocked, id=11928]
          0x012bb450 JavaThread "Reference Handler" daemon [_thread_blocked, id=1272]
          0x005da8c8 JavaThread "main" [_thread_in_native, id=7440]

          Other Threads:
          0x012b7450 VMThread [id=6572]
          0x005debb8 WatcherThread [id=6788]

          VM state:not at safepoint (normal execution)

          VM Mutex/Monitor currently owned by a thread: None

          Heap
          def new generation total 9152K, used 3910K [0x035b0000, 0x03f90000, 0x05d10000)
          eden space 8192K, 36% used [0x035b0000, 0x03891aa0, 0x03db0000)
          from space 960K, 99% used [0x03ea0000, 0x03f8fff8, 0x03f90000)
          to space 960K, 0% used [0x03db0000, 0x03db0000, 0x03ea0000)
          tenured generation total 121024K, used 65097K [0x05d10000, 0x0d340000, 0x235b0000)
          the space 121024K, 53% used [0x05d10000, 0x09ca26c8, 0x09ca2800, 0x0d340000)
          compacting perm gen total 131072K, used 56037K [0x235b0000, 0x2b5b0000, 0x335b0000)
          the space 131072K, 42% used [0x235b0000, 0x26c694b8, 0x26c69600, 0x2b5b0000)
          No shared spaces configured.

          Dynamic libraries:
          0x00400000 - 0x0040d000 D:\MyEclipse\jre\bin\javaw.exe
          0x77420000 - 0x7755d000 C:\Windows\SYSTEM32\ntdll.dll
          0x75920000 - 0x759f4000 C:\Windows\system32\kernel32.dll
          0x755f0000 - 0x7563a000 C:\Windows\system32\KERNELBASE.dll
          0x762a0000 - 0x76340000 C:\Windows\system32\ADVAPI32.dll
          0x75870000 - 0x7591c000 C:\Windows\system32\msvcrt.dll
          0x77590000 - 0x775a9000 C:\Windows\SYSTEM32\sechost.dll
          0x75c80000 - 0x75d21000 C:\Windows\system32\RPCRT4.dll
          0x77150000 - 0x77219000 C:\Windows\system32\USER32.dll
          0x763c0000 - 0x7640e000 C:\Windows\system32\GDI32.dll
          0x77570000 - 0x7757a000 C:\Windows\system32\LPK.dll
          0x77220000 - 0x772bd000 C:\Windows\system32\USP10.dll
          0x75a00000 - 0x75a1f000 C:\Windows\system32\IMM32.DLL
          0x75bb0000 - 0x75c7c000 C:\Windows\system32\MSCTF.dll
          0x6d640000 - 0x6d7dd000 D:\MyEclipse\jre\bin\client\jvm.dll
          0x73c10000 - 0x73c42000 C:\Windows\system32\WINMM.dll
          0x75470000 - 0x754bb000 C:\Windows\system32\apphelp.dll
          0x6d290000 - 0x6d298000 D:\MyEclipse\jre\bin\hpi.dll
          0x77560000 - 0x77565000 C:\Windows\system32\PSAPI.DLL
          0x6d610000 - 0x6d61c000 D:\MyEclipse\jre\bin\verify.dll
          0x6d310000 - 0x6d32d000 D:\MyEclipse\jre\bin\java.dll
          0x6d630000 - 0x6d63f000 D:\MyEclipse\jre\bin\zip.dll
          0x72000000 - 0x72012000 D:\MyEclipse\eclipse\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.1.R33x_v20070828\eclipse_1020.dll
          0x72d30000 - 0x72db4000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7600.16661_none_ebfb56996c72aefc\COMCTL32.dll
          0x74a70000 - 0x74a79000 C:\Windows\system32\VERSION.dll
          0x74450000 - 0x74490000 C:\Windows\system32\uxtheme.dll
          0x33ff0000 - 0x3404e000 C:\Program Files\360\360Safe\safemon\safemon.dll
          0x76410000 - 0x77059000 C:\Windows\system32\SHELL32.dll
          0x76070000 - 0x760c7000 C:\Windows\system32\SHLWAPI.dll
          0x772c0000 - 0x7741c000 C:\Windows\system32\ole32.dll
          0x77060000 - 0x770ef000 C:\Windows\system32\OLEAUT32.dll
          0x62800000 - 0x62866000 C:\Windows\system32\MSVCP60.dll
          0x75e30000 - 0x75e65000 C:\Windows\system32\WS2_32.dll
          0x77580000 - 0x77586000 C:\Windows\system32\NSI.dll
          0x745d0000 - 0x7476e000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7600.16661_none_420fe3fa2b8113bd\Comctl32.dll
          0x754c0000 - 0x754cc000 C:\Windows\system32\CRYPTBASE.dll
          0x775c0000 - 0x77643000 C:\Windows\system32\CLBCatQ.DLL
          0x6d4d0000 - 0x6d4e3000 D:\MyEclipse\jre\bin\net.dll
          0x74fb0000 - 0x74fec000 C:\Windows\system32\mswsock.dll
          0x74fa0000 - 0x74fa6000 C:\Windows\System32\wship6.dll
          0x6d4f0000 - 0x6d4f9000 D:\MyEclipse\jre\bin\nio.dll
          0x343c0000 - 0x3440f000 D:\MyEclipse\eclipse\configuration\org.eclipse.osgi\bundles\505\1\.cp\swt-win32-3346.dll
          0x76340000 - 0x763bb000 C:\Windows\system32\comdlg32.dll
          0x75d30000 - 0x75e25000 C:\Windows\system32\WININET.dll
          0x75a20000 - 0x75b56000 C:\Windows\system32\urlmon.dll
          0x75660000 - 0x7577c000 C:\Windows\system32\CRYPT32.dll
          0x755e0000 - 0x755ec000 C:\Windows\system32\MSASN1.dll
          0x75e70000 - 0x7606a000 C:\Windows\system32\iertutil.dll
          0x74120000 - 0x74133000 C:\Windows\system32\dwmapi.dll
          0x34440000 - 0x34448000 D:\MyEclipse\eclipse\configuration\org.eclipse.osgi\bundles\435\1\.cp\os\win32\x86\localfile_1_0_0.dll
          0x73ad0000 - 0x73b0c000 C:\Windows\system32\oleacc.dll
          0x35ae0000 - 0x35af4000 D:\MyEclipse\eclipse\configuration\org.eclipse.osgi\bundles\505\1\.cp\swt-gdip-win32-3346.dll
          0x742c0000 - 0x74450000 C:\Windows\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7600.16385_none_72fc7cbf861225ca\gdiplus.dll
          0x74ff0000 - 0x75006000 C:\Windows\system32\CRYPTSP.dll
          0x74d70000 - 0x74dab000 C:\Windows\system32\rsaenh.dll
          0x75560000 - 0x7556e000 C:\Windows\system32\RpcRtRemote.dll
          0x674b0000 - 0x674de000 C:\Windows\system32\mlang.dll
          0x74bd0000 - 0x74be7000 C:\Windows\system32\USERENV.dll
          0x75570000 - 0x7557b000 C:\Windows\system32\profapi.dll
          0x74b00000 - 0x74b05000 C:\Windows\System32\wshtcpip.dll
          0x74e70000 - 0x74eb4000 C:\Windows\system32\DNSAPI.dll
          0x711d0000 - 0x711f1000 C:\Program Files\Bonjour\mdnsNSP.dll
          0x73a00000 - 0x73a1c000 C:\Windows\system32\Iphlpapi.DLL
          0x739f0000 - 0x739f7000 C:\Windows\system32\WINNSI.DLL
          0x70fa0000 - 0x70fa6000 C:\Windows\system32\rasadhlp.dll
          0x73240000 - 0x73278000 C:\Windows\System32\fwpuclnt.dll
          0x739e0000 - 0x739e5000 C:\Windows\system32\msimg32.dll
          0x738d0000 - 0x738e0000 C:\Windows\system32\NLAapi.dll
          0x6f780000 - 0x6f790000 C:\Windows\system32\napinsp.dll
          0x6f740000 - 0x6f752000 C:\Windows\system32\pnrpnsp.dll
          0x6f790000 - 0x6f79d000 C:\Windows\system32\wshbth.dll
          0x6f770000 - 0x6f778000 C:\Windows\System32\winrnr.dll
          0x6d4c0000 - 0x6d4c8000 D:\MyEclipse\jre\bin\management.dll
          0x6eec0000 - 0x6eee1000 D:\MyEclipse\eclipse\configuration\org.eclipse.osgi\bundles\588\1\.cp\libapr.dll
          0x6ee50000 - 0x6ee59000 D:\MyEclipse\eclipse\configuration\org.eclipse.osgi\bundles\588\1\.cp\libapriconv.dll
          0x365a0000 - 0x366a8000 D:\MyEclipse\eclipse\configuration\org.eclipse.osgi\bundles\588\1\.cp\libeay32.dll
          0x712b0000 - 0x712b7000 C:\Windows\system32\WSOCK32.dll
          0x36710000 - 0x367d4000 D:\MyEclipse\eclipse\configuration\org.eclipse.osgi\bundles\588\1\.cp\libdb44.dll
          0x364e0000 - 0x36511000 D:\MyEclipse\eclipse\configuration\org.eclipse.osgi\bundles\588\1\.cp\ssleay32.dll
          0x6ee60000 - 0x6ee89000 D:\MyEclipse\eclipse\configuration\org.eclipse.osgi\bundles\588\1\.cp\libaprutil.dll
          0x36520000 - 0x36532000 D:\MyEclipse\eclipse\configuration\org.eclipse.osgi\bundles\588\1\.cp\intl3_svn.dll
          0x37890000 - 0x37999000 D:\MyEclipse\eclipse\configuration\org.eclipse.osgi\bundles\588\1\.cp\libsvnjavahl-1.dll
          0x70920000 - 0x70925000 C:\Windows\system32\SHFOLDER.dll
          0x6ee40000 - 0x6ee45000 C:\Program Files\Subversion\iconv\_tbl_simple.so
          0x361d0000 - 0x361d9000 C:\Program Files\Subversion\bin\libapriconv-1.dll
          0x36230000 - 0x36252000 C:\Program Files\Subversion\bin\libapr-1.dll

          VM Arguments:
          jvm_args: -Xms128m -Xmx512m -Duser.language=en -XX:PermSize=128M -XX:MaxPermSize=256M
          java_command: D:\MyEclipse\eclipse\plugins\org.eclipse.equinox.launcher_1.0.1.R33x_v20070828.jar -os win32 -ws win32 -arch x86 -showsplash -launcher D:\MyEclipse\eclipse\eclipse.exe -name Eclipse --launcher.library D:\MyEclipse\eclipse\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.1.R33x_v20070828\eclipse_1020.dll -startup D:\MyEclipse\eclipse\plugins\org.eclipse.equinox.launcher_1.0.1.R33x_v20070828.jar -exitdata 2178_a4 -vm D:\MyEclipse\jre\bin\javaw.exe -vmargs -Xms128m -Xmx512m -Duser.language=en -XX:PermSize=128M -XX:MaxPermSize=256M -jar D:\MyEclipse\eclipse\plugins\org.eclipse.equinox.launcher_1.0.1.R33x_v20070828.jar
          Launcher Type: SUN_STANDARD

          Environment Variables:
          JAVA_HOME=D:\JAVA\jdk1.6
          CLASSPATH=.;D:\JAVA\jdk1.6\lib\tools.jar;D:\JAVA\jdk1.6\lib\dt.jar;C:\Program Files\Sun\JavaDB\lib\derbytools.jar;C:\Program Files\Sun\JavaDB\lib\derby.jar;C:\Program Files\Subversion\bin;D:\JAVA\jre1.6\lib\ext\QTJava.zip
          PATH=C:\oracle10g\product\10.2.0\db_1\bin;C:\Oracle\Ora92\bin\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;D:\JAVA\jdk1.6\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\DMIX;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Hewlett-Packard\OpenView\service desk 4.5\client\bin;C:\Program Files\Sun\JavaDB\bin;C:\Program Files\Subversion\bin;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\IDM Computer Solutions\UltraEdit\
          USERNAME=Bill
          OS=Windows_NT
          PROCESSOR_IDENTIFIER=x86 Family 6 Model 37 Stepping 5, GenuineIntel



          --------------- S Y S T E M ---------------

          OS: Windows NT 6.1 Build 7600

          CPU:total 4 (cores per cpu 8, threads per core 2) family 6 model 5 stepping 5, cmov, cx8, fxsr, mmx, sse, sse2, ht

          Memory: 4k page, physical 2097151k(962372k free), swap 4194303k(2784484k free)

          vm_info: Java HotSpot(TM) Client VM (1.5.0_11-b03) for windows-x86, built on Dec 15 2006 01:16:12 by "java_re" with MS VC++ 6.0

          網上說是subversion有沖突,但我嘗試xp版本沒問題,估計可能是win7、eclipse、sublicpse和subversion之間可能有沖突,解決方法是:
          將系統的環境變量 APR_ICONV_PATH改為APR_ICONV1_PATH

          論壇里說:
          Subclipse can crash on Windows if you have the environment variable
          APR_ICONV_PATH set and it is pointing at a set of libraries that were
          built against Apache 2.2. If that is the case, change the environment
          variable name to APR_ICONV1_PATH and that will fix the problem. The
          libraries from 2.2 will look for the variable with the "1" in it first
          anyway. So this is a proper change to make.

          If you want to be thorough, you could download the zip file for
          Subversion 1.4.3, and point the APR_ICONV_PATH variable at the iconv
          folder that came with it.

          但這里的問題似乎與Apache2.2以及subversion無關,因為自己用的時subversion1.6,且win7和win xp之間不同,所以還是覺得是win7版本的問題。。。如果有哪位高人也曾遇到過或知道詳解,還請告知,謝謝!

          posted @ 2011-09-15 18:09 bisal 閱讀(1094) | 評論 (0)編輯 收藏

          向Oracle插入timestamp類型字段

          如果是中文字符集:

          [TEST@ora10gr1#2009-11-25/08:39:38]

          SQL>create table t1(t timestamp);

          Table created.

          [TEST@ora10gr1#2009-11-25/08:39:56]

          SQL>insert into t1 values(to_timestamp('21NOV09 10:04:12.032','DDMONYY HH24:MI:SS.FF'));

          * ERROR at line 1: ORA-01843: not a valid month

          應該指定用american字符集插入就對了:

          [TEST@ora10gr1#2009-11-25/08:39:56]

          SQL>insert into t1 values(to_timestamp('21NOV09 10:04:12.032','DDMONYY HH24:MI:SS.FF','nls_date_language=american'));

          1 row created.

          posted @ 2009-11-26 09:22 bisal 閱讀(3310) | 評論 (0)編輯 收藏

          Cloud Compute

                 最近,Cloud Compute,也就是“云計算”備受關注,或者說是因為一些大廠商鋪天蓋地的宣傳才導致自web2.0以來又一個互聯網應用的new wave。。。

                 首先,掃下盲,啥時云計算?云計算是一個虛擬化的計算機資源池,也是一種新的IT資源提供模式,可以簡單地將他理解成一個數據中心,這個數據中心的計算機可以自動地管理和動態的分配、部署、配置、重新配置以及回收資源,也可以自動安裝軟件和應用。云計算的構成包括硬件、軟件和服務。硬件主要是x86或Power的及其。軟件包括管理計算機自動化的軟件,以及被管理的軟件。

                之前說了,各大廠商對于云計算的重視才將這個名詞拖到互聯網的最前端,例如Amazon的EC2,Google的GAE,IBM的blue cloud,Yahoo!的Hadoop(其實IBM也采用了這種架構),微軟的SCOPE,以及SUN的black box計劃。

                Amzaon的EC2的應用似乎時間最長,也是大眾最能感受到的云計算,值得一提的是,Oracle CEO,Larry曾經在open world中說云計算多么多么的沒用,但同時,Oracle就宣稱與Amazone合作推出了融合中間件。。。

                IBM也和Google合作建立了一個用于云計算的大型數據中心,要說云計算,可能互聯網就是一個最大的云,換句話說,Google更是這個大云的最大受益者,也許它們也應該感謝十年前微軟的錯誤定位,沒有將互聯網放在眼里,只是專做desktop。。。Google沒有自己的服務器,但IBM有強大的Power PC,強強聯合自然更加厲害。。。

                Microsoft這次估計也是不想再次重蹈覆轍,也投身于云計算的研究中,Midori計劃是一個微軟基于云計算開發的操作系統,云計算,自然要結合到微軟的看家之寶Windows上,其核心是可以讓其運行在任何設備上,因為幾乎所有的云計算都是免費的,所以有人說Midori也許是第一套微軟開發的免費操作系統,呵呵。。。

                但我覺得最感興趣的,就是Sun的black box計劃,下圖展示的便是black box計劃,與IBM相比,Sun也有著高性能服務器領域的優勢,Ultra SPARC處理器和Solaris操作系統,black box,從字面意思解釋,就是黑盒子,這種黑盒子即可以為擁有上萬名員工的大型公司服務,也能為中小企業提供支持,其移動和方便部署的特性,也能用于在后救援等工作。黑盒子位于標準的20英尺長的集裝箱內,容納了數量眾多的服務器集群,黑盒子的部署很簡單,只要接入電纜、水龍頭(水冷散熱)和網絡線纜,黑盒子便可以投入運作,它可以安置在倉庫角落、大樓停車場、樓頂天臺或是某個荒郊野嶺,是不是很酷?呵呵


          posted @ 2008-12-21 01:12 bisal 閱讀(381) | 評論 (0)編輯 收藏

          robots協議標準

              前兩天剛知道用爬蟲抓取page有個協議的問題,尤其是對于open source的爬蟲,剛看到一篇blog,寫的就是如此,難怪之前看google的robots也和另外一個U.S.的網站相同,感情是大家都商量好了, 可能這方面中國的一些站點這種意識要稍微淡一點。。。同時這也害得畢設還得另謀思路。。。

              搜索引擎三巨頭打的不亦樂乎,但偶爾也合作一下。去年Google,雅虎,微軟就合作,共同遵守統一的Sitemaps標準。前兩天三巨頭又同時宣布,共 同遵守的 robots.txt文件標準。Google,雅虎,微軟各自在自己的官方博客上發了一篇帖子,公布三家都支持的robots.txt文件及Meta標簽 的標準,以及一些各自特有的標準。下面做一個總結。


          三家都支持的robots文件記錄包括:

          Disallow - 告訴蜘蛛不要抓取某些文件或目錄。如下面代碼將阻止蜘蛛抓取所有的網站文件:

          User-agent: *

          Disallow: /

          Allow - 告訴蜘蛛應該抓取某些文件。Allow和Disallow配合使用,可以告訴蜘蛛某個目錄下,大部分都不抓取,只抓取一部分。如下面代碼將使蜘蛛不抓取ab目錄下其他文件,而只抓取其中cd下的文件:

          User-agent: *

          Disallow: /ab/

          Allow: /ab

          $通配符 - 匹配URL結尾的字符。如下面代碼將允許蜘蛛訪問以.htm為后綴的URL:

          User-agent: *

          Allow: .htm$

          *通配符 - 告訴蜘蛛匹配任意一段字符。如下面一段代碼將禁止蜘蛛抓取所有htm文件:

          User-agent: *

          Disallow: /*.htm

          Sitemaps位置 - 告訴蜘蛛你的網站地圖在哪里,格式為:Sitemap: <sitemap_XXXXXX>


          三家都支持的Meta標簽包括:

          NOINDEX - 告訴蜘蛛不要索引某個網頁。

          NOFOLLOW - 告訴蜘蛛不要跟蹤網頁上的鏈接。

          NOSNIPPET - 告訴蜘蛛不要在搜索結果中顯示說明文字。

          NOARCHIVE - 告訴蜘蛛不要顯示快照。

          NOODP - 告訴蜘蛛不要使用開放目錄中的標題和說明。

          上面這些記錄或標簽,現在三家都共同支持。其中通配符好像以前雅虎微軟并不支持。百度現在也支持Disallow,Allow及兩種通配符。Meta標簽我沒有找到百度是否支持的官方說明。


          只有Google支持的Meta標簽有:

          UNAVAILABLE_AFTER - 告訴蜘蛛網頁什么時候過期。在這個日期之后,不應該再出現在搜索結果中。

          NOIMAGEINDEX - 告訴蜘蛛不要索引頁面上的圖片。

          NOTRANSLATE - 告訴蜘蛛不要翻譯頁面內容。


          雅虎還支持Meta標簽:

          Crawl-Delay - 允許蜘蛛延時抓取的頻率。

          NOYDIR - 和NOODP標簽相似,但是指雅虎目錄,而不是開放目錄。

          Robots-nocontent - 告訴蜘蛛被標注的部分html不是網頁內容的一部分,或者換個角度,告訴蜘蛛哪些部分是頁面的主要內容(想被檢索的內容)。

          MSN還支持Meta標簽:Crawl-Delay

              另外提醒大家注意的是,robots.txt文件可以不存在,返回404錯誤,意味著允許蜘蛛抓取所有內容。但抓取robots.txt文件時卻發生超時 之類的錯誤,可能導致搜索引擎不收錄網站,因為蜘蛛不知道robots.txt文件是否存在或者里面有什么內容,這與確認文件不存在是不一樣的。

          posted @ 2008-07-29 14:53 bisal 閱讀(700) | 評論 (0)編輯 收藏

          oracle 10g express edition安裝刪除心得。。。

               由于要使用ODM,最好還是裝個oracle,但可能由于本科時使用過oracle 9i的緣故,搞的現在還是好擔心它的運行情況,所以下了個Oracle 10g的Express Edition,只有200多MB,比標準版小得多,但目前還不知道它對ODM工具的支持情況。。。
               第一次裝Oracle 10g Express Edition的時候,由于可能是有tomcat和Heritrix占用了8080端口,導致裝的過程中提示錯誤,沒太在意,但無法啟動主頁面,查了資料,一種說法是改掉其它占用8080端口的軟件,一種是改oracle的端口,照著做了一下,兩種方法都試了,但依舊無法啟動oracle,期間報了兩種錯誤:
          1、ORA-01034: ORACLE not available
              ORA-27101: shared memory realm does not exist
          2、ORA-01033:   ORACLE   initialization   or   shutdown   in   progress  
               有的說是因為SID_NAME和SERVICE_NAME重復,或者是有多個實例,但改了沒有起作用,所以最后決定重新安裝,但新的問題出現了,這個版本果然是簡版,連刪除程序都沒有。。。暈。。。直接刪目錄說有個dll文件無法訪問,沒辦法直接刪除,后來經曉晨的詢問,確定了可以從注冊表中刪除的方法,先是刪除了注冊表中HEKY-LOCAL-MACHINE的SOFTWARE里與Oracle相關的,但重裝時仍舊提示oracle的service在運行,即使在服務中停掉了,讓然禁止刪除。。。后來查了一下,得知服務需要在HKEY-LOCAL-MACHINE的SYSTEM-CurrentControlSet里的Services中刪除與oracle相關的項,重啟,重裝,訪問到10g的主頁面,由于是簡版,主頁面是一個基于Web Page的。。。
               由于Oracle改默認端口比較麻煩,所以初學者最好還是裝前將8080端口空出來,避免不必要的麻煩,但我覺得仍舊可以在裝好oracle之后改它的默認端口,有些資料也是這樣說的,有時間可以試一試,現在的問題是如何配合oracle使用Data Miner?如果哪位技術牛人有這方面的經驗,希望可以與你們交流~
               最后,再次感謝曉晨!呵呵

          我的qq:173635235
              msn:bisal1130@yahoo.com.cn

          posted @ 2008-07-29 14:38 bisal 閱讀(1979) | 評論 (3)編輯 收藏

          提問:Heritrix抓取問題

          Heritrix應用問題 請教一下大家如何用heritrix抓取以下網站內容,需要定制么?

          下面是USPTO的專利網頁:
          http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&Sect2=HITOFF&u=%2Fnetahtml%2FPTO%2Fsearch-adv.htm&r=0&f=S&l=50&d=PTXT&OS=+%28battery+OR+motor%29+AND+automobile&RS=%28%28battery+OR+motor%29+AND+automobile%29&Query=+%28battery+OR+motor%29+AND+automobile&TD=45309&Srch1=%28%28battery+OR+motor%29+AND+automobile%29&NextList1=Next+50+Hits
          其中NextList1表示第一個50條信息的頁面,NextList2,NextList3,以此類推,在這些頁面中點擊每條超鏈接得到的是針對此條專利 信息的具體頁面,那么現在我如何設置heritrix,可以抓取到每頁50條,一共幾萬條的這些具體專利信息頁面到本地呢?另外可否抓取的同時將html 格式轉換偽txt格式到本地?謝謝高手指點!

          歡迎交流:
          qq:      173635235
          msn:    bisal1130@yahoo.com.cn
          email:  bill1130@gmail.com

          posted @ 2008-07-10 08:35 bisal 閱讀(1063) | 評論 (1)編輯 收藏

          Google Map小示例

          北京奧運會場館

          posted @ 2008-06-13 11:51 bisal 閱讀(360) | 評論 (0)編輯 收藏

          iphone VS Android ?

              自從Apple去年上半年發布了iphone,已經成為了手機業界一股新的力量,開始重新劃分mobile這塊大蛋糕,據說全球有30億的手機用戶,那么 這個市場可以堪稱是第二個Internet,隨著無線技術的發展,智能手機的愈趨完善,手機不只是我們用來打電話的工具了,電郵,IM,錄音,甚至剛看到 馬寧寫的為某公司設計的一個基于windows mobile的BPM系統,手機正在改變人們的生活,還有office,好像扯遠了,呵呵。。。
              iphone確實是手機發展的一個milestone,multi-touch技術,無線功能,Mac OS,先進的內置傳感器等等,再加上Apple這個無形的品牌,確實讓人激動,也顯示出Steve的Apple所具有的一種魄力,我還沒有使用過 iphone,只是在公車上見過有人用,虛擬的QWerty鍵盤,鏡面屏,真的讓人很想好好看一下,呵呵
              直到最近,看到Google推出了它的mobile計劃,但是有些特別,并不是一個gphone,而是一個手機platform,基于Linux內核的開 源項目,換句話說,相對于Symbian,Windows Mobile這些封閉系統,它是一個open的環境,允許開發人員,甚至個人對其進行擴展和開發,由于還采用了APL協議,相對于大家所熟知的GPL, APL允許你對APL代碼進行使用,但可以對你開發的code不必使用APL,不必開放出來,這樣做也會吸引很多廠商
              對了,這個platform的名稱是Android,這個名稱是Google早些時候收購的一家廠商,它的CEO是Andy Rubin,他也是這個platform的主要創始人,Android包括有用戶應用層,應用框架,庫和運行時環境,底層Linux內核四個層次,同時提 供了一個SDK,供開發人員使用,還有基于Eclipse的插件,看了一下截圖,感覺很直觀,可視化效果很好,同時由于Google的原因,所以很多 Google的服務都可以很方便的嵌入,比如Google Map等等,大家有興趣的話,可以下載Android的SDK或是它的Eclipse插件ADT,參照教程,自己試一試,也許年底或是明年上半年就會有所 謂的gphone樣機,不知道那時候大家會選擇iphone還是gphone?
              呵呵,對了,Android還有一個或者說是對于程序員來說,比較吸引人的地方,就是它采用java實現和擴展,這樣就可以讓一些java程序員只需學習Android,就可以進行嵌入式開發這個領域了,是不是很誘人呢?呵呵,一切走著瞧吧~

          posted @ 2008-02-11 16:56 bisal 閱讀(992) | 評論 (0)編輯 收藏

          導航

          統計

          常用鏈接

          留言簿(4)

          隨筆檔案

          文章檔案

          相冊

          Java戰友兄弟

          常用技術交流平臺

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 广昌县| 且末县| 徐州市| 化州市| 东阳市| 西峡县| 湖南省| 肇庆市| 海口市| 安溪县| 宝山区| 读书| 昂仁县| 丰都县| 襄汾县| 北海市| 宝山区| 荃湾区| 日照市| 卓尼县| 舞钢市| 大同县| 从江县| 综艺| 岳西县| 德阳市| 类乌齐县| 军事| 西青区| 海淀区| 榆中县| 灵寿县| 正定县| 黔南| 盐池县| 碌曲县| 柳州市| 宣汉县| 讷河市| 巨鹿县| 遵义市|