随笔-75  评论-193  文章-5  trackbacks-0
  2012年3月2日
var fixgeometry = function() {
    /* Some orientation changes leave the scroll position at something
     * that isn't 0,0. This is annoying for user experience. */
    scroll(0, 0);
    /* Calculate the geometry that our content area should take */
    var header = $(".header:visible");
    var footer = $(".footer:visible");
    var content = $(".content:visible");
    var viewport_height = $(window).height();
    
    var content_height = viewport_height - header.outerHeight() - footer.outerHeight();
    
    /* Trim margin/border/padding height */
    content_height -= (content.outerHeight() - content.height());
    content.height(content_height);
  }; /* fixgeometry */
  $(document).ready(function() {
    $(window).bind("orientationchange resize pageshow", fixgeometry);
  });
posted @ 2013-01-28 10:59 The Matrix 阅读(5139) | 评论 (1)编辑 收藏
http://java.dzone.com/articles/hibernate-tuning-queries-using?page=0,0 
posted @ 2012-05-14 14:28 The Matrix 阅读(1179) | 评论 (0)编辑 收藏
环境:
    
    Centos6.2(安装在Vmware7.0中)
    Magento1.6.2
    Apache Httpd Server 2.2.15
    MySql 5.1.61
    PHP5.3.3

安装过程:

    apache http、mysql、php及相关扩展安装:
    其中apache http、Mysql、php都是利用centos的添加/删除软件功能进行安装。同时使用该功能安装"php-xml"、"php-gd"、"php-pdo"、"php-mbstring"、"php-mysql"扩展。
    使用chkconfig配置httpd和mysql为系统服务。命令如下:
    chkconfig httpd on
    chkconfig -add mysqld
    chkconfig mysqld on
    使用chkconfig --list 可以查看所有的服务配置状态
    使用service httpd start、service mysqld start启动httpd和mysqld服务。可以通过service httpd restart重启相关服务。
    此时访问本机的http://localhost可以看到apache的欢迎界面,同时编辑index.php文件,其内容如下:
    <?php
        phpinfo();
    ?>
    并将该文件置于/var/www/html目录下,访问http://localhost/index.php,此时应该不能看到php版本信息,仅能看到index.php的静态文本内容。
    修改/etc/httpd/conf/httpd.conf文件,修改如下:
    DirectoryIndex index.html index.html.var ->  DirectoryIndex index.html index.htm index.php
    增加:
    AddType application/x-httpd-php .php
    AddDefaultCharset -> AddDefaultCharset off  (解决中文乱码问题)
    增加一段VirtualHost描述,如下(在配置文件的最后):
    <VirtualHost *:80>
        DocumentRoot /var/www/smallfive
        ServerName smallfive
        ServerAlias smallfive.com *.smallfive.com
    </VirtualHost>
    此时访问http://localhost/index.php,应该一切正常

    设置数据库:
    使用mysqladmin -u root password 'newpassword'设置mysql数据库的默认密码
    让数据库更安全:
    mysql -u root -p    进入mysql
    mysql> DROP DATABASE test;                删除test数据库
    mysql> DELETE FROM mysql.user WHERE user = '';       删除匿名帐户
    mysql> FLUSH PRIVILEGES;                 重载权限
    创建magento数据库
    mysql> CR   访问magento数据库,确保一切正常

    配置Magento:
    解压缩magento1.6.2版本至/var/www/smallfive/magento目录
    解压命令:
   EATE DATABASE magento;
    mysql> GRANT ALL PRIVILEGES ON magento.* TO 'root'@'localhost' IDENTIFIED BY 'newpassword'; 
  tar zxvf magento1.6.2.tar.gz
    此时访问http://localhost/magento,可根据magento的设置进行配置
   
    注意如下问题:
    1、确保当前用户拥有对/var/www/smallfive/magento可读可写权限
    2、还需安装mcrypt库,安装这个库比较繁琐,mcrypt依赖于Libmcrypt库和mhash库,我们需要下载Libmcrypt库和mhash库安装它们,然后再编译Mcrypt。
    在编译之前,先做好如下准备工作:
        a、安装phpize:yum -y install php-devel
        b、安装C++脚本编译模块:
            yum -y install gcc gcc-g++
            yum -y install gcc gcc-c++
    安装mcrypt库过程,如下:
        a、下载libmcrypt和mhash库
            Libmcrypt:http://sourceforge.net/project/showfiles.php?group_id=87941&package_id=91774&release_id=487459
            mhash:http://sourceforge.net/project/showfiles.php?group_id=4286&package_id=4300&release_id=645636
        b、将上述两个下载后,分别解压,并执行如下命令编译:
            ./configure
            make && make install
        c、下载php对应的源代码,解压,
            进入php源代码的 /ext/mcrypt目录
            执行phpize命令
            ./configure –with-php-config=/usr/bin/php-config
            make && make install
        d、在php.ini文件中增加如下内容:
            extension=/usr/lib/php/modules/mcrypt.so
            mcrypt.so文件路径在php-config文件中可以找到
        e、service httpd restart
   
    end!
     
    参考文章:
    http://www.eexu.com/article.asp?id=1730
    http://www.ruiwant.com/centos-6-0%E4%B8%8Bmagento%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE%E6%80%BB%E7%BB%93.html
    http://zixun.www.net.cn/qita/2344.html
    http://os.qudong.com/Linux/2010/0210/64441.html
posted @ 2012-04-04 17:09 The Matrix 阅读(3098) | 评论 (1)编辑 收藏
有时在vmware里面安装的系统或应用有License时间的限制,可以通过修改虚拟机时间的方法来防止过期,此时需在.vmx文件中加入下面的内容:
tools.syncTime = "FALSE"
time.synchronize.continue = "FALSE"
time.synchronize.restore = "FALSE"
time.synchronize.resume.disk = "FALSE"
time.synchronize.shrink = "FALSE"
rtc.startTime = 1183431600  #这是用来指定虚拟机启动后的时间。数字是自1970年1月1日零时零分零秒以来的秒数,可以通过如下网址将某个时间转换为该数字(Unix时间戳):http://www.onlineconversion.com/unix_time.htm

注意:同时还需在虚拟机操作系统的服务中,停用“VMware Tools Service”的服务。
在Windows Server 2003中操作系统自身也有时间同步功能,需在时间设定中停用,同时停用“Windows Timer”服务。
posted @ 2012-03-02 10:51 The Matrix 阅读(8592) | 评论 (0)编辑 收藏