手机浏览 RSS 2.0 订阅 膘叔的简单人生 , 腾讯云RDS购买 | 超便宜的Vultr , 注册 | 登陆
浏览模式: 标准 | 列表2008年11月的文章

继续解决ZendStudio5菜单中部分是方框的问题

昨天刚刚解决ZS白屏的问题,再次启动的时候,确实是正常了。。。
然而部份菜单却是方框,查了一些资料,发现是中文字体的问题,于是,将Windows下的宋体(simsun.ttc)拷贝过来,改名为: LucidaSansRegular.ttf,覆盖掉:/usr/local/Zend/ZendStudio-5.5.1/jre/lib/fonts 下的同名文件。

即:

XML/HTML代码
  1. unlink /usr/local/Zend/ZendStudio-5.5.1/jre/lib/fonts/LucidaSansRegular.ttf  
  2. cp /media/disk/WINDOWS/Fonts/simsun.ttc  /usr/local/Zend/ZendStudio-5.5.1/jre/lib/fonts/LucidaSansRegular.ttf  

 

Tags: ubuntu, zend, zendstudio, 方框, 中文

Ubuntu下ZS5.5打开之后是空白屏幕的解决方案

安装了ubuntu之后,立马安装上了zendstudio 5.5 结果出现空白屏幕,以为是不兼容呢。也就没注意。然后安装了一个 ZS for eclipse 6,一切正常。更加肯定了自己的机器与ZS5的不兼容。

可是,我的屏幕只有12。1,在ZS6下面,能够给我写代码的地方太小了。。。。简直无法下手。

于是就想怎么解决5。5的问题。

想不到啊。一直劝别人:内事不决问百度外事不决问google的,象ZS这种进口软件,我居然没有想到问问google。不过,我问了Vampire(政委)同学,他采用了我教别人的方法,然后给了我条答案。

不敢独享。。。

以下内容来自官方网站,地址为:http://www.zend.com/support/knowledgebase.php?kbid=241,不翻译了,也没有什么好翻译的。。。。

Zend Studio starts up with an empty window, or other GUI problems, due to XGL-Compiz/Beryl (with JRE) compatibility issues

Article #241
Product: Zend Studio

 

Symptoms




When running Zend Studio:
1. The ZS's main window comes up totally empty.
2. Sometimes the window has some of the frames painted, but the rest of the window is empty.
3. In the empty ZS window the mouse cursor is changing while moving around the window (as if there are objects: like buttons and other objects).
4. There were erratic mouse/window movements reported.

Summary




Zend Studio starts up with various windowing GUI problems in some linux distros, while using the XGL-Compiz/Beryl product.

Cause




1. Incompatibility between the XGL environment, the JRE, and the Zend Studio Client.
2. The decoration in the 3D environment clashes with the Java Runtime and distorts the operation and visualization of the Zend Studio client's window.

Workaround




There are two ways to execute Zend Studio, by running the ZDE script, and by running the runStudio_unix.sh script, both are in the bin directory of zend studio
(usually /usr/local/Zend/ZendStudio-/bin)

The following workarounds may be used, but there is no guarantee how well or how long it might work for you in your environment.

  •  
  • modification of ZDE script for xgl:
  •  


1. Open your ZDE script with your favorite editor
2. add the next line of code at line 1693.
options="$options -Dawt.toolkit=sun.awt.motif.MToolkit"

for example:
1693:
1694: debugOut ""
1695: unset POSIXLY_CORRECT
1696: if [ $DO_NOT_FORK ]

becomes:
1693: options="$options -Dawt.toolkit=sun.awt.motif.MToolkit"
1694: debugOut ""
1695: unset POSIXLY_CORRECT
1696: if [ $DO_NOT_FORK ]

3. Save the file.

  •  
  • modification of runStudio_unix.sh script for xgl:
  •  


1. open the the file in your favorite editor.
2. modify the java execution line,
the line starts with: ../jre/bin/java -Xms16m -Xmx256m -cp...
change it to: ../jre/bin/java -Dawt.toolkit=sun.awt.motif.MToolkit -Xms16m -Xmx256m -cp...
^^^^^^^^^^^^^^^^^^^^^^^^^^
as you can see, the only difference is an extra parameter to the java program.
3. Save the file.

Another solution




the AWT_TOOLKIT environment variable can be set in order for Java to choose a working AWT Toolkit.

export AWT_TOOLKIT="MToolkit"

In most Linux Distributions it's enough to append this line to /etc/profile.

The information in this article applies to




Zend Studio Client

Common Problems



On some amd64 based systems, the motif toolkit will not work, complaining that "current locale is not supported in X11".

A solution for this case is to set the XLOCALELIBDIR environment variable to the X11 32 bit locale
directory of your system.
Ubuntu Distribution users will find it at: /usr/lib32/X11/locale.

Ubuntu users can use the following as a startup-script:
#!/bin/bash
export AWT_TOOLKIT=MToolkit
export XLOCALELIBDIR=/usr/lib32/X11/locale
exec ZendStudio-5.5.0/Zend_Development_Environment

  •  
  • more information can be found:
  •  


http://alioth.debian.org/tracker/index.php?func=detail&aid=301730&group_id=30192&atid=410386

Keywords




Zend Studio, ZS, ZDE, IDE, Installation, XGL, Compiz, Beryl, unsupported, blank, empty, window, decoration,xgl

Last Updated: 2008-01-07 09:50:08

Tags: ubuntu, zendstudio, 空白屏幕, 官方, 解决方案

jQuery的html()等方法介绍

本来是看到一篇文章,写研究的,想COPY过来就完事了。该来来自于cssRain,但是在看的过程中,发现内容和标准偏差很多,于是就贴上它的链接,然后自己谈谈理解吧。

CSSRAIN的链接为:http://www.cssrain.cn/article.asp?id=1176

在jQuery里面对于一些HTML的元素操作都是很简化的,这也是很多人选择使用jQuery的原因。

对于获取某一个元素的值,如input框,我们往往是用$('#test').val();

$('#test')这个我就不多说了,反正就是获取ID为test的这个元素。

$('#test').val(),也就是获取它的值,一般来说,凡是能够用在FORM里的元素,都可以用.val()来进行值的获取,如input,textarea,select等,都可以用.val()来获取它们的当前值

而.val('aa');则是设置该元素的值,$('#test').val('aa'),也就是相当于设置test元素的值为aa。

类似这样的用法还有两种:.html(),.text(),这两种用法往往用在div和span元素上,一般是为这两种元素进行赋值和取值。

.html()替代了以前的 .innerHTML , .html('test') ,则是替代了 .innerHTML = 'test';

这些类似的简化写法让我们在实际的操作中感觉得更加流畅。

这些方法都是直接在方法名里加参数来进行赋值和取值的。还有一些是通过第二个参数进行取值的(说的不太清楚。。。),比如$('#test').attr('name'),那么,返回的值就是它的attribute中的name了,如果$('#test').attr('id','test2'),则是相当于把这个test元素的name设为test2,再进行取值的时候,name就是test2了。

说的太乱了。。。。

懒得整理,权当笔记

Tags: jquery, html, 研究

PDF下载:《High Performance MySQL》

回忆未来的张宴推荐了这本书,并且在他的博客上提供了下载的链接,链接是新浪的爱问:点此下载《High Performance MySQL Second Edition》PDF电子版,并且博客上还有详细介绍:

  XML/HTML代码

  1. High Performance MySQL Second Edition  
  2. 作者: Baron Schwartz / Peter Zaitsev / Vadim Tkachenko / Jeremy Zawodny / Arjen Lentz / Derek Balling  
  3.   
  4. 副标题: Optimization, Backups, Replication, and More  
  5. ISBN: 9780596101718  
  6. 页数: 708  
  7. 定价: USD 49.99  
  8. 出版社: O'Reilly Media, Inc.  
  9. 装帧: Paperback  
  10. 出版年: 2008-06-18  
  11.   
  12. High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity.  
  13.   
  14. High Performance MySQL teaches you advanced techniques in depth so you can bring out MySQL's full power. Learn how to design schemas, indexes, queries and advanced MySQL features for maximum performance, and get detailed guidance for tuning your MySQL server, operating system, and hardware to their fullest potential. You'll also learn practical, safe, high-performance ways to scale your applications with replication, load balancing, high availability, and failover.  
  15.   
  16. This second edition is completely revised and greatly expanded, with deeper coverage in all areas. Major additions include:  
  17. * Emphasis throughout on both performance and reliability  
  18. * Thorough coverage of storage engines, including in-depth tuning and optimizations for the InnoDB storage engine  
  19. * Effects of new features in MySQL 5.0 and 5.1, including stored procedures, partitioned databases, triggers, and views  
  20. * A detailed discussion on how to build very large, highly scalable systems with MySQL  
  21. * New options for backups and replication  
  22. * Optimization of advanced querying features, such as full-text searches  
  23. * Four new appendices  
  24. The book also includes chapters on benchmarking, profiling, backups, security, and tools and techniques to help you measure, monitor, and manage your MySQL installations.  

为此,张宴还提供了一张图片:

 

大小: 5.18 K
尺寸: 106 x 139
浏览: 1836 次
点击打开新窗口浏览全图

 

整篇博客我作了一下整理和排序,想看原文的,请到:http://blog.s135.com/read.php?381,因为在这个页面上张宴采用了划词翻译,如果有看不懂英文的话,选中一下就会自动翻译了。。我没有提供。也不想再插入一些代码。呵呵

为了方便大家,我也上传了这个文件,大家可以点击下载:high.performance.mysql_second.edition.zip


Tags: mysql, database, pdf, download

MySQL之表结构修改[转]

Author:丹臣 posted on Taobao.com

mysql数据库里,对一个已创建的表进行DDL操作,比如说添加一个字段。在做测试时,发现ddl操作的时间特别的长。oracle里,通常情况下只是 修改数据字典就可以了,操作时间非常的短,阻塞DML的时间也比较短。mysql数据库对表进行ddl操作跟oracle数据库有很大的不同,它先要把原 表拷贝一份到临时表,这期间不阻塞select,阻塞所有的更改操作(update,delete,insert),对临时表ddl操作完成,删除原表, 重命名临时表。
如果一张比较大的表进行ddl变更,比如说40G,那拷贝的时间让人无法忍受,并且阻塞所有的DML操作,让业务无法继续。

以下是测试过程:

mysql> desc t1;
+-------------------+------------------+------+-----+---------+-------+
| Field                  | Type               | Null   | Key | Default | Extra |
+-------------------+------------------+------+-----+---------+-------+
| id                      | int(11)            | YES  | MUL | NULL    |       |
| nick                   | varchar(32)   | YES  |         | NULL    |       |
| email                 | varchar(32)    | YES  |         | NULL    |       |
| gmt_create       | datetime         | YES  |         | NULL    |       |
| gmt_modified    | datetime        | YES  |         | NULL    |       |
+-------------------+------------------+------+-----+---------+-------+
mysql> select count(*) from t1;
+----------+
| count(*) |
+----------+
|  2228017 |
+----------+
1 row in set (1.78 sec)

现在对它进行表结构变更,增加一列:

mysql> alter table t1 add(tel varchar(20));
Query OK, 2304923 rows affected (41.03 sec)
Records: 2304923  Duplicates: 0  Warnings: 0

在上述表结构变更过程中,启动另外一个会话,进行select查询操作和一个更新操作:

mysql> select count(*) from t1;
+---------------+
| count(*)      |
+---------------+
|  2304923     |
+---------------+
1 row in set (2.10 sec)

mysql> select * from t1 limit 10;
+------+-------+------------------------+----------------------------+----------------------------+
| id      | nick   | email                       | gmt_create                 | gmt_modified              |
+------+-------+------------------------+----------------------------+----------------------------+
|    0   | nick0 | nick0@taobao.com | 2008-03-14 00:00:00 | 2008-03-14 00:00:00 |
|    1   | nick1 | nick1@taobao.com | 2008-03-14 00:00:00 | 2008-03-14 00:00:00 |
|    2   | nick2 | nick2@taobao.com | 2008-03-14 00:00:00 | 2008-03-14 00:00:00 |
|    3   | nick3 | nick3@taobao.com | 2008-03-14 00:00:00 | 2008-03-14 00:00:00 |
|    4   | nick4 | nick4@taobao.com | 2008-03-14 00:00:00 | 2008-03-14 00:00:00 |
|    5   | nick5 | nick5@taobao.com | 2008-03-14 00:00:00 | 2008-03-14 00:00:00 |
|    6   | nick6 | nick6@taobao.com | 2008-03-14 00:00:00 | 2008-03-14 00:00:00 |
|    7   | nick7 | nick7@taobao.com | 2008-03-14 00:00:00 | 2008-03-14 00:00:00 |
|    8   | nick8 | nick8@taobao.com | 2008-03-14 00:00:00 | 2008-03-14 00:00:00 |
|    9   | nick9 | nick9@taobao.com | 2008-03-14 00:00:00 | 2008-03-14 00:00:00 |
+------+-------+------------------------+----------------------------+----------------------------+
10 rows in set (0.00 sec)

mysql> update t1 set nick='test_nick' where id=1;
Query OK, 4 rows affected (43.89 sec)          --这里是阻塞的时间
Rows matched: 4  Changed: 4  Warnings: 0

通过以上实验可以看出,对表进行ddl操作时,mysql并不阻塞select查询,但会严重阻塞dml操作。另外,如果你要对表进行ddl操作,由于有一个拷贝操作,你要计算好你的可用空间够不够?如果你的系统经常要进行表结构变更,那么你将不得不要考虑此问题!

--EOF--

膘叔:说实话,一般对于表的操作往往都是在夜深人静的时候,虽然select并不影响,但为避免在更新表结构的时候更新数据,这还是必须的。。。以防万一啊

 

Tags: mysql, database, 修改, 表结构, taobao dba

Records:4012345678