发布新日志

  • java程序启动失败

    2009-01-09 21:11:15

    Error occurred during initialization of VM

    Could not reserve enough space for object heap

    Could not create the Java virtual machine.

    启动tomcat时出现了以上的提示

    修改方案:

    把原来server -Xms256m -Xmx512m" 改成server -Xms256m -Xmx256m"才能启动


  • qtp 不能识别webelement的输入框解决方法

    2008-10-22 20:29:58

    Browser("网易电子邮箱 - 极速3.0正式版").Page("网易电子邮箱 - 极速3.0正式版").Frame("HtmlEditor").WebElement("html tag:= BODY").Object.Focus
    Dim wsh
    Set wsh = createobject("wscrīpt.shell")
    wsh.sendkeys "abcdefg"
    Set wsh = nothing

     

    但我目前还不知道具体focus属性是什么

  • qtp 描述性编程 对象

    2008-10-22 20:29:58

    例如,假设我们需要完成以下一个操作:

    Window("Error").WinButton("text:=OK", "index:="1"").Click

    我们可以通过Descrīption对象来实现同样的功能,参加下面的代码:

    Set MyDescrīption = Descrīption.Create()

    MyDescrīption("text").Value = "OK"

    MyDescrīption("index").Value = 1

    Window("Error").WinButton(MyDescrīption).Click

    Set MyDescrīption = Nothing

  • mysql 不能远程登录

    2008-10-16 16:18:11

    mysql的host一般是两种

    localhost和远程%

    但今天出现了一个比较奇怪的问题,一个user有 localhost的域和一个%远程登录的域,但不能远程登录,只能本地登录。

    为什么呢?

  • 虚拟机 识别u盘

    2008-10-16 14:47:39

    虚拟机和主系统在同一个时间点只能有一个挂载u盘。

    通过点击虚拟机-vm-移动设备-u盘-具体的usb盘来切换挂载u盘的系统。当虚拟机挂载后,主系统则读不到该u盘,而且在虚拟机的右下方会有u盘的图标。

  • mysql root 用户不能登录的问题

    2008-10-16 14:37:44

    #apt-get install mysql-server-5.0

    #mysql -u root

    Enter password:
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

    发现不能登录。或者登录后没有权限操作。原因是因为在安装时没有给root设置密码而默认其为空的。

    可以尝试以下的方法:
    方法1 执行 root@hettvm2:~# mysqladmin -u root password 123456

    设置了root的密码。

    方法2 

    # /etc/init.d/mysql stop
    # mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
    # mysql -u root mysql
    mysql> UPDATE user SET Password=PASSWORD('123456') where USER='root';
    mysql> FLUSH PRIVILEGES;
    mysql> quit

    # /etc/init.d/mysql restart
    # mysql -uroot -p
    Enter password: <输入新设的密码newpassword>

    mysql> 

    方法3

    MySQL安装之后,root的密码是空的。为了提高安全性有必要给root加上密码。 

    mysql –u root –p 

    password: 

    mysql>SET PASSWORD FOR 'root'@'localhost' = PASSWORD('Password'); 


    下次登陆时,就必须输入密码了。

    给其他用户付权限则使用下面的语句:

    grant all privileges on *.* to $usrname@"localhost" identified by "$password"

    注:$是变量。表示用户名和密码

        localhost是本地。如果是远程登录的话应该使用 “%”。

    在mysql里有一张记录用户的表


    mysql> use mysql;
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A

    Database changed
    mysql> select host,user,password from user;
    +-----------+------------------+-------------------------------------------+
    | host | user | password |
    +-----------+------------------+-------------------------------------------+
    | localhost | root | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 | 
    | hettvm2 | root | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 | 
    | 127.0.0.1 | root | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 | 
    | localhost | | | 
    | hettvm2 | | | 
    | localhost | debian-sys-maint | *6E20E21227143F48BD9E44BC7352C8855AE14A52 | 
    | % | starent | *BE6D39BA79EE21926B287198D86AC1573DA755EC | 
    | % | hettvm2 | *BE6D39BA79EE21926B287198D86AC1573DA755EC | 
    | localhost | hettvm2 | *BE6D39BA79EE21926B287198D86AC1573DA755EC | 
    +-----------+------------------+-------------------------------------------+
    9 rows in set (0.00 sec)

    mysql> 

    可以通过这个表查询用户。




  • 工作学习日志0925

    2008-09-25 19:45:52

    发现一个笔记奇怪的现象,在终端,80G的硬盘fdisk -l 看到的容量和df看到的容量不一致。uclibc[app]# ./fdisk -l
    Disk /dev/ide/host0/bus0/target1/lun0/disc: 80.0 GB, 80026361856 bytes
    255 heads, 63 sectors/track, 9729 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
      Device Boot Start End Blocks Id System
    /dev/ide/host0/bus0/target1/lun0/part1 1 9729 78148161 83 Linux
    uclibc[app]# df
    Filesystem 1k-blocks Used Available Use% Mounted on
    /dev/root 1024 920 104 90% /
    /dev/ide/host0/bus0/target1/lun0/part1 76920416 306824 72706184 0% /root

    答:这两个单位是不一样的。用df看到的是以M为单位,而用fdisk 看到的是


    lsmod 查看系统加载了哪些模块
    insmod 加载模块的命令。


  • qtp 获取web table

    2008-07-08 16:19:48

    Set Cell = Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebTable("New York to San Francisco")' 这样 Cell = New York To San Francisco 这个table了。

    Set Functionout = ObjectsByMicClass(Cell, "WebElement")

  • qtp 文件读写

    2008-07-07 14:32:33

    fileobject = fso.Getfile(path)

    TextSream = FileObject.OpenAsTextStream(mode,format)

    TextStream = FSO.CreateText.File(filename, bOverwrite)

    注意三个函数的返回值。

     

    例子一:

    Dim txtapp
    Dim  f

    Set txtapp =  CreateFile("d:/qtp.txt",true)   '返回TextSream.
    WriteToFile txtapp ,"this is the fist line"     '直接把txtapp放到WriteToFile里

    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

    Function CreateFile(sFile, bOverwrite)

        Set fso = CreateObject("scrīpting.FileSystemObject")

        set CreateFile = fso.CreateTextFile(sFile, bOverwrite)   '返回TextSream.并且注意这个时候不能执行 CreateFile.close.否则后面就不能写入。(因为和后面写入的是同一个 TextStream .)
     

    End Function

    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

    function  WriteToFile(sFilename, sLine)
     
    Const ForWriting =2
    Set fso = CreateObject("scrīpting.FileSystemObject")

    sFilename.Write sLine

    sFilename.Close

    End function

    ***********************************************************************************

    ************************************************************************************

    例子2

    Dim txtapp

    Set txtapp =  CreateFile("d:/qtp.txt",true)   '返回TextSream.

    WriteToFile "d:/qtp.txt" ,"this is the fist line" '是把路径传给了 WriteToFile.

    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

    Function CreateFile(sFile, bOverwrite)

        Set fso = CreateObject("scrīpting.FileSystemObject")

        set CreateFile = fso.CreateTextFile(sFile, bOverwrite)   '返回TextSream
      CreateFile.close                                    '注意 一定要关闭。否则下次打开的时候,就不能写入

    End Function

    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

    function  WriteToFile(sFilename, sLine)
    Dim getf
    Dim f
    Const ForWriting = 2
    Set fso = CreateObject("scrīpting.FileSystemObject")

    set  getf =fso. getfile(sFilename) '返回 file object ,这时进来的是 path

    Set f =getf.OpenAsTextStream( ForWriting,-2) '返回text sream

    f.Write sLine

    f.Close

    End function

     

     

     


     

     

     

     

     


     

  • qtp plus 实例 分析

    2008-07-04 14:13:47

    在 qtp plus中有这么一段代码,

    Function SaveWorkbook(ExcelApp, workbookIdentifier, path) 'As String

      Dim workbook 'As Excel.workbook

      On Error Resume Next

      Set workbook = ExcelApp.Workbooks(workbookIdentifier)

      On Error GoTo 0

      If Not workbook Is Nothing Then

      If path = "" Or path = workbook.FullName Or path = workbook.Name Then

      workbook.Save

    但在运行时workbook = ExcelApp.Workbooks(workbookIdentifier)会提示找不到对象。通过断点调试,发现workbook是空的。

    找了一天都没找到原因,后来无意发现当record and run setting里,web和app都选择 record and run on  any******后运行就通过。

    具体原因未知。 

我的栏目

数据统计

  • 访问量: 5440
  • 日志数: 10
  • 建立时间: 2008-07-04
  • 更新时间: 2009-01-09

RSS订阅

Open Toolbar