随笔-75  评论-193  文章-5  trackbacks-0
  2011年3月25日
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)编辑 收藏
主要参见:http://blog.chenlb.com/2011/03/install-apache-php-wordpress-windows.html

在安装好apache http server后,如果端口不正确,则修改"apache安装目录/conf/httpd.conf"文件中的如下信息:
Listen 80  -> Listen 8060
#ServerName localhost:80 -> ServerName localhost:8060

Apache HTTP Server版本:2.2
PHP版本:5.3.8
WordPress版本:3.2.1
posted @ 2011-11-27 21:28 The Matrix 阅读(617) | 评论 (0)编辑 收藏

1. 打开工具Oracle SQL Plus 以dba身份登录sys用户
sqlplus /nolog
conn sys@url as sysdba

2. 创建用户并指定表空间

使用客户端工具或者Web管理控制台创建表空间以及用户
给用户赋予connect、resource、dba权限
grant connect,resource,dba to username;


注意:给oracle用户分配connect、resource角色时,此时connect 角色中有一个 UNLIMITED TABLESPACE 权限,也就是username这个用户可以在其他表空间里随意建表。
revoke unlimited tablespce from username;     --撤销username用户在任意表空间建表的权限
alter user username quota 0 on users;      --alter username quota 0 on Users;  // 还不是很清楚具体含义???
alter user username quota unlimited on tablespacename;   --赋予username用户在tablespacename表空间任意建表的权限;

 


3. 使用imp工具导入dmp数据文件
imp username/password@url file=c:\db.dmp fromuser=username1 touser=username log=c:\log.txt


-------------------------------------------------------------------------------------------------------------
其它命令:
select * from dba_users;    --查询用户

select * from dba_tables;    --查询表
select * from dba_views;    --查询视图
select * from dba_tablespaces;    --查询表空间


oracle 10g,查询表空间使用率
Select * from sys.DBA_TABLESPACE_USAGE_METRICS;
-------------------------------------------------------------------------------------------------------------

drop user username cascade;

ORA-01940:无法删除当前已连接的用户

select username, sid, serial# from v$session where username='username';

alter system kill session'sid,serial#'

 

posted @ 2011-05-31 16:43 The Matrix 阅读(3861) | 评论 (0)编辑 收藏
环境:Windows7 professional

1、下载redmine1.1.3.zip、ruby1.8.7、rubygems-1.3.7.zip、mysql 5.0

2、安装MySQL5.0,cmd窗口下使用mysql -u root -p 登录MySQL数据库,执行如下语句创建redmine数据库及用户:
create database redmine character set utf8;
create user 'redmine'@'localhost' identified by 'my_password';
grant all privileges on redmine.* to 'redmine'@'localhost';
注:
    使用MySQL5.5在后面进行初始数据时Ruby会提示连接有问题
    在安装完MySQL后,先不要进行配置,至“MySQL安装路径\bin”目录下,修改MySQLInstanceConfig.exe为“以管理员成分执行此程序”,“以兼容模式运行该程序”
    进行数据库配置时,选择字符集为utf8

3、运行ruby1.8.7安装包,解压至d:/ruby187,将d:/ruby187/bin添加至path环境变量中
安装后可执行 ruby -v查看ruby版本以检验安装是否正确

4、解压rubygems-1.3.7.zip至d:/rubygems-1.3.7
进入d:/rubygems-1.3.7目录,执行ruby setup.rb
注:Redmine需要rubygems 1.3.1 - 1.5.x,肯定不能用1.8.2版本

5、执行gem install rails -v=2.3.5 远程安装rails2.3.5版本
gem install mysql
gem install -v=0.4.2 i18n

6、解压缩redmine1.1.3至d:/redmine1.1.3目录
进入d:/redmine-1.1.3/config目录,修改database.yml.example文件为database.yml,并修改该文件中的production数据库连接配置为如下:
production:
  adapter: mysql
  database: redmine
  host: localhost
  username: redmine
  password: my_password
  encoding: utf8

进入d:/redmine1.1.3目录,执行
rake config/initializers/session_store.rb
rake db:migrate RAILS_ENV="production"

7、加载默认配置数据
rake redmine:load_default_data RAILS_ENV="production"
默认语言选择"zh"

8、运行
ruby script/server webrick -e production

9、访问:http://localhost:3000
使用admin/admin进行登入
进入设置,把默认语言设为“简体中文”,然后设置当前用户的默认语言设为“简体中文”,这样就是中文界面了

-----------------------------------------

继续,将redmine设置为windows 7的服务

1、首先需要配置mysql为windows 7的服务

2、Ruby提供一个安装Ruby程序为服务的包:mongrel_service。安装其实很简单,运行:gem install mongrel_service

3、安装redmine为服务,执行mongrel_rails service::install -N RedMine -c C:\redmine-1.1.3 -p 3000 –e production
注意:此处打开cmd窗口时,需要输入cmd后,不是直接按Enter,而是按 Ctrl+Shift+Enter打开Cmd窗口,此时以管理员身份打开,否则安装为服务时会提示拒绝访问。

4、安装服务后,需检查服务-e后的参数是不是production,如果不是production而是development,则在注册表中把参数手动改为production。修改方法是:打开“注册表编辑器”,展开分支“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services”,选择redmine服务,找到ImagePath项,修改保存后在服务列表中启动服务,并把服务设置自动启动。

OK!
posted @ 2011-05-20 10:25 The Matrix 阅读(2752) | 评论 (0)编辑 收藏
参见如下链接:
http://www.41post.com/3255/programming/unity3d-creating-a-gui-with-both-3d-and-2d-elements
posted @ 2011-03-25 21:33 The Matrix 阅读(1170) | 评论 (0)编辑 收藏