迄今为止Root的最累的一次机

Category : 技术生活

Comments : 暂无评论

Author : qpwoeiru96

DateTime : 2012/01/25

Tags : Android,Root

距离上一篇帖子《迄今为止刷的最累的一次机》还不到一天,我又折腾起我的P970来。

大家知道Android不Root,就相当于自己的女人不开庖。

所以在刷完V20G之后我就急急的想给我的女人开庖,但是开庖没那么好开啊。得用工具啊。

所以Google开始了。 几个小时又下来了,发现这真的是迄今为止Root的最累的一次机,而且还没成功,唉,悲剧。

在XDA看到一个Root V20N成功的家伙,发现真的是太折腾人了。

I was able to root my Optimus Black all on my own!!! I used a combination of SuperOneClick, Gingerbreak and Unlock Root!

 

Here is what I did:

1. Run SuperOneClick, and wait until is stops. It normally stops at step 7 for me.[运行SOC知道它停止,一般在第七步停住。]

2. While SuperOneClick is still running, run GingerBreak.[当SOC还在运行的时候运行GingerBreak,就是手机上的那个程序。]

3. While SuperOneClick AND GingerBreak are still running, run Unlock Root[当上面两个都还在运行的时候,运行unlock root。]

4. And Voala! Rooted![ 哇哇 我挂了 累死的]

 

That is what I did to unroot, I don't know if it will work for anybody else, but it's worth a try.[这么折腾的方法值得一试。]

 

Cheers!

所以我想说Root V20G真的是折腾死人,关键是你不知道他什么时候就Root成功了。纯粹就是拼RP,我RP比较差拼不了。

阅读剩余部分...

迄今为止刷的最累的一次机

Category : 技术生活

Comments : 暂无评论

Author : qpwoeiru96

DateTime : 2012/01/24

Tags : Android,Root

因为是Windows 7 32bit的系统,所以用KDZ方式刷机的时候老是碰到 MOD UpTestEX MFC Application 错误,搞了好几个小时,实在没辙只好在Windows XP下刷机,还是在虚拟机里的。

阅读剩余部分...

ActionScript 3 初体验 之 渐变函数

Category : 技术生活

Comments : 暂无评论

Author : qpwoeiru96

DateTime : 2012/01/14

Tags : ActionScript

我们知道ActionScript 动作脚本是遵循 ECMAscript第四版 的 Adobe Flash Player 运行时环境的编程语言。所有对于会JavaScript的童鞋来说上手ActionScript那并不难。 这是我今天用AS3写的渐变函数。

import flash.display.MovieClip;
import flash.display.Sprite;
import flash.display.Stage;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;

const _ROOT = this; //设置全局对象

//初始函数

function init()
{
	stage.scaleMode = StageScaleMode.NO_SCALE; //设置场景不随着Resize而改变大小 就是不缩放
	stage.align = StageAlign.TOP; //对齐方式设置为垂直顶上 水平居中
	
	mountain.alpha = 0; //设置几个MovieClip的透明度为0
	logo.alpha = 0;
	cloud.alpha = 0;
	
	_ROOT.stop(); //停止跳转到第二帧
	
	fadeIn(cloud, 1, function() { //逐渐显示的效果
		fadeIn(mountain, 2, function() {
			fadeIn(logo, 1, function() {
				fadeOut( cloud );
				fadeOut( mountain );
				fadeOut( logo );
				fadeOut(background_1, 1.2, function() {
					_ROOT.nextFrame();   
				});				  
			});
		});   
	});
	
}

/*
 * 淡出函数
 * @param movieclip movieclip object
 * @param duration 间隔时间 单位为秒
 * @param callback 回调函数
 */
function fadeOut( movieclip, duration = 1, callback = null ) 
{
	var tmp:Tween = new Tween( movieclip, 'alpha', Strong.easeIn, 1, 0, duration, true );
	if( typeof arguments[2] == 'function' )
	{
		tmp.addEventListener( TweenEvent.MOTION_FINISH , arguments[2] );
	}
	tmp.start();
}

/*
 * 淡入函数
 * @param movieclip movieclip object
 * @param duration 间隔时间 单位为秒
 * @param callback 回调函数
 */
function fadeIn( movieclip, duration = 1, callback = null )
{
	var tmp:Tween = new Tween( movieclip, 'alpha', Strong.easeIn, 0, 1, duration, true );
	if( typeof arguments[2] == 'function' )
	{
		tmp.addEventListener( TweenEvent.MOTION_FINISH , arguments[2] );
	}
	tmp.start();
}

init();




一段节选自《代码之美》的简单正则代码

Category : 技术生活

Comments : 暂无评论

Author : qpwoeiru96

DateTime : 2012/01/12

Tags : C,正则

/* match: search for regexp anywhere in text */ 
 int match(char *regexp, char *text) 
 { 
     if (regexp[0] == '^') 
         return matchhere(regexp+1, text); 
     do {    /* must look even if string is empty */ 
         if (matchhere(regexp, text)) 
             return 1; 
     } while (*text++ != '\0'); 
     return 0; 
 } 
 
 /* matchhere: search for regexp at beginning of text */ 
 int matchhere(char *regexp, char *text) 
{ 
    if (regexp[0] == '\0') 
        return 1; 
    if (regexp[1] == '*') 
        return matchstar(regexp[0], regexp+2, text); 
 
    if (regexp[0] == '$' && regexp[1] == '\0') 
        return *text == '\0'; 
    if (*text!='\0' && (regexp[0]=='.' || regexp[0]==*text)) 
        return matchhere(regexp+1, text+1); 
    return 0; 
 } 
 
 /* matchstar: search for c*regexp at beginning of text */ 
 int matchstar(int c, char *regexp, char *text) 
 { 
      do {   /* a * matches zero or more instances */ 
        if (matchhere(regexp, text)) 
            return 1; 
    } while (*text != '\0' && (*text++ == c || c == '.')); 
    return 0; 
 }

Linux Bash实现自动MySQL远程备份

Category : 技术生活

Comments : 暂无评论

Author : qpwoeiru96

DateTime : 2012/01/11

Tags : Linux,CentOS,Bash

基本思路是利用mysqldump导出到sql文件,然后利用rar加密压缩利用FTP上传到远程FTP空间。

Linux 下的Rar请到http://www.rarlab.com/ 下载。我的环境是CentOS

#!/bin/bash
FILENAME=$(date +%Y%m%d)
echo time: $FILENAME
#exit
echo exporting
/usr/local/mysql/bin/mysqldump --all-databases --quick --add-drop-table --socket=/tmp/mysql.sock  --allow-keywords --complete-insert --compress  > mysql.db.backup.sql
echo compressing
rar a  "./backup/${FILENAME}_db_backup.rar" mysql.db.backup.sql -pYOURPASSWORD
cd backup
echo Uploading
ftp -n<<!
open FTPADDRESS
user FTPUSER FTPPASSWORD
cd backup
put ${FILENAME}_db_backup.rar ${FILENAME}_backup.bak
quit
!
echo Backup Successful

1.png

2.png

顺便放一下MySQL的常用参数:

格式可选描述[Chinese]描述[English]Introduction
--add-drop-database add-drop-database 每个CREATE DATABASE语句前添加DROP DATABASE语句 Add a DROP DATABASE statement before each CREATE DATABASE statement  
--add-drop-table add-drop-table 每个CREATE TABLE语句前添加DROP TABLE语句 Add a DROP TABLE statement before each CREATE TABLE statement  
--add-drop-trigger add-drop-trigger 每个CREATE TRIGGER语句前添加DROP TRIGGER语句 Add a DROP TRIGGER statement before each CREATE TRIGGER statement 5.1.47-ndb-7.1.8
--add-locks add-locks 在每个表导出之前增加LOCK TABLES并且之后UNLOCK TABLE。 Surround each table dump with LOCK TABLES and UNLOCK TABLES statements  
--all-databases all-databases 导出所有数据库中的所有表 Dump all tables in all databases  
--all-tablespaces all-tablespaces   Adds to a table dump all SQL statements needed to create any tablespaces used by an NDB Cluster table 5.1.6
--allow-keywords allow-keywords 允许创建关键字列名。应在每个列名前面加上表名前缀。 Allow creation of column names that are keywords  
--bind-address=ip_address bind-address 在具有多个网络接口的计算机,这个选项可以用来选择哪个接口连接到MySQL服务器时采用。 Use the specified network interface to connect to the MySQL Server 5.1.22-ndb-6.3.4
--comments comments 如果设置为 0,禁止转储文件中的其它信息,例如程序版本、服务器版本和主机。--skip—comments与---comments=0的结果相同。 默认值为1,即包括额外信息。 Add comments to the dump file  
--compact compact 产生少量输出。该选项禁用注释并启用--skip-add-drop-tables、--no-set-names、--skip-disable-keys和--skip-add-locking选项。 Produce more compact output  
--compatible=name[,name,...] compatible 产生与其它数据库系统或旧的MySQL服务器更兼容的输出。值可以为ansi、mysql323、mysql40、postgresql、oracle、mssql、db2、maxdb、no_key_options、no_tables_options或者no_field_options。要使用几个值,用逗号将它们隔开。 Produce output that is more compatible with other database systems or with older MySQL servers  
--complete-insert complete-insert 使用包括列名的完整的INSERT语句。 Use complete INSERT statements that include column names  
--create-options create-options 在CREATE TABLE语句中包括所有MySQL表选项。 Include all MySQL-specific table options in CREATE TABLE statements  
--databases databases 转储几个数据库。通常情况,mysqldump将命令行中的第1个名字参量看作数据库名,后面的名看作表名。使用该选项,它将所有名字参量看作数据库名。CREATE DATABASE IF NOT EXISTS db_name和USE db_name语句包含在每个新数据库前的输出中。 Dump several databases  
--debug[=debug_options] debug 写调试日志。debug_options字符串通常为'd:t:o,file_name'。 Write a debugging log  
--debug-check debug-check   Print debugging information when the program exits 5.1.21
--debug-info debug-info   Print debugging information, memory and CPU statistics when the program exits 5.1.14
--default-character-set=charset_name default-character-set 使用charsetas默认字符集。如果没有指定,mysqldump使用utf8。 Use charset_name as the default character set  
--delayed-insert delayed-insert 使用INSERT DELAYED语句插入行。 Write INSERT DELAYED statements rather than INSERT statements  
--delete-master-logs delete-master-logs 在主复制服务器上,完成转储操作后删除二进制日志。该选项自动启用--master-data。 On a master replication server, delete the binary logs after performing the dump operation  
--disable-keys disable-keys 对于每个表,用/*!40000 ALTER TABLE tbl_name DISABLE KEYS */;和/*!40000 ALTER TABLE tbl_name ENABLE KEYS */;语句引用INSERT语句。这样可以更快地装载转储文件,因为在插入所有行后创建索引。该选项只适合MyISAM表。 For each table, surround the INSERT statements with statements to disable and enable keys  
--dump-date dump-date   Include dump date as "Dump completed on" comment if --comments is given 5.1.23
--events events   Dump events from the dumped databases 5.1.8
--extended-insert extended-insert   Use multiple-row INSERT syntax that include several VALUES lists  
--fields-enclosed-by=string fields-enclosed-by   This option is used with the --tab option and has the same meaning as the corresponding clause for LOAD DATA INFILE  
--fields-escaped-by fields-escaped-by   This option is used with the --tab option and has the same meaning as the corresponding clause for LOAD DATA INFILE  
--fields-optionally-enclosed-by=string fields-optionally-enclosed-by   This option is used with the --tab option and has the same meaning as the corresponding clause for LOAD DATA INFILE  
--fields-terminated-by=string fields-terminated-by   This option is used with the --tab option and has the same meaning as the corresponding clause for LOAD DATA INFILE  
--first-slave first-slave 不赞成使用,现在重新命名为--lock-all-tables。 Deprecated; use --lock-all-tables instead  
--flush-logs flush-logs 开始转储前刷新MySQL服务器日志文件。该选项要求RELOAD权限。请注意如果结合--all--database(或-A)选项使用该选项,根据每个转储的数据库刷新日志。例外情况是当使用--lock-all-tables或--master-data的时候:在这种情况下,日志只刷新一次,在所有 表被锁定后刷新。如果你想要同时转储和刷新日志,应使用--flush-logs连同--lock-all-tables或--master-data。 Flush the MySQL server log files before starting the dump  
--flush-privileges flush-privileges   Emit a FLUSH PRIVILEGES statement after dumping the mysql database  
--help     Display help message and exit  
--hex-blob hex-blob 使用十六进制符号转储二进制字符串列(例如,'abc' 变为0x616263)。影响到的列有BINARY、VARBINARY、BLOB。 Dump binary columns using hexadecimal notation (for example, 'abc' becomes 0x616263)  
--host host 从给定主机的MySQL服务器转储数据。默认主机是localhost。 Host to connect to (IP address or hostname)  
--ignore-table=db_name.tbl_name ignore-table   Do not dump the given table  
--insert-ignore insert-ignore   Write INSERT IGNORE statements rather than INSERT statements  
--lines-terminated-by=string lines-terminated-by   This option is used with the --tab option and has the same meaning as the corresponding clause for LOAD DATA INFILE  
--lock-all-tables lock-all-tables 所有数据库中的所有表加锁。在整体转储过程中通过全局读锁定来实现。该选项自动关闭--single-transaction和--lock-tables。 Lock all tables across all databases  
--lock-tables lock-tables 开始转储前锁定所有表。用READ LOCAL锁定表以允许并行插入MyISAM表。对于事务表例如InnoDB和BDB,--single-transaction是一个更好的选项,因为它不根本需要锁定表。 请注意当转储多个数据库时,--lock-tables分别为每个数据库锁定表。因此,该选项不能保证转储文件中的表在数据库之间的逻辑一致性。不同数据库表的转储状态可以完全不同。 Lock all tables before dumping them  
--log-error=file_name log-error   Append warnings and errors to the named file 5.1.18
--master-data[=value] master-data 该选项将二进制日志的位置和文件名写入到输出中。该选项要求有RELOAD权限,并且必须启用二进制日志。如果该选项值等于1,位置和文件名被写入CHANGE MASTER语句形式的转储输出,如果你使用该SQL转储主服务器以设置从服务器,从服务器从主服务器二进制日志的正确位置开始。如果选项值等于2,CHANGE MASTER语句被写成SQL注释。如果value被省略,这是默认动作。 --master-data选项启用--lock-all-tables,除非还指定--single-transaction(在这种情况下,只在刚开始转储时短时间获得全局读锁定。又见--single-transaction。在任何一种情况下,日志相关动作发生在转储时。该选项自动关闭--lock-tables。 Write the binary log file name and position to the output  
--max_allowed_packet=value max_allowed_packet 客户端/服务器之间通信的缓存区的最大大小。最大为1GB。 The maximum packet length to send to or receive from the server  
--net_buffer_length=value net_buffer_length 客户端/服务器之间通信的缓存区的初始大小。当创建多行插入语句时(如同使用选项--extended-insert或--opt),mysqldump创建长度达net_buffer_length的行。如果增加该变量,还应确保在MySQL服务器中的net_buffer_length变量至少这么大。 The buffer size for TCP/IP and socket communication  
--no-autocommit no-autocommit   Enclose the INSERT statements for each dumped table within SET autocommit = 0 and COMMIT statements  
--no-create-db no-create-db 该选项禁用CREATE DATABASE /*!32312 IF NOT EXISTS*/ db_name语句,如果给出---database或--all--database选项,则包含到输出中。 This option suppresses the CREATE DATABASE statements  
--no-create-info no-create-info 不写重新创建每个转储表的CREATE TABLE语句。 Do not write CREATE TABLE statements that re-create each dumped table  
--no-data no-data 不写表的任何行信息。如果你只想转储表的结构这很有用。 Do not dump table contents  
--no-set-names no-set-names   Same as --skip-set-charset  
--no-tablespaces no-tablespaces   Do not write any CREATE LOGFILE GROUP or CREATE TABLESPACE statements in output 5.1.14
--opt opt 该选项是速记;等同于指定 --add-drop-tables--add-locking --create-option --disable-keys--extended-insert --lock-tables --quick --set-charset。它可以给出很快的转储操作并产生一个可以很快装入MySQL服务器的转储文件。该选项默认开启,但可以用--skip-opt禁用。要想只禁用确信用-opt启用的选项,使用--skip形式;例如,--skip-add-drop-tables或--skip-quick。 Shorthand for --add-drop-table --add-locks --create-options --disable-keys --extended-insert --lock-tables --quick --set-charset.  
--order-by-primary order-by-primary   Dump each table's rows sorted by its primary key, or by its first unique index  
--password[=password] password 连接服务器时使用的密码。如果你使用短选项形式(-p),不能在选项和密码之间有一个空格。如果在命令行中,忽略了--password或-p选项后面的 密码值,将提示你输入一个。 The password to use when connecting to the server  
--pipe     On Windows, connect to server using a named pipe  
--port=port_num port 用于连接的TCP/IP端口号。 The TCP/IP port number to use for the connection  
--quick quick 该选项用于转储大的表。它强制mysqldump从服务器一次一行地检索表中的行而不是检索所有行并在输出前将它缓存到内存中。 Retrieve rows for a table from the server a row at a time  
--quote-names quote-names 用‘`’字符引用数据库、表和列名。如果服务器SQL模式包括ANSI_QUOTES选项,用‘"’字符引用名。默认启用该选项。可以用--skip-quote-names禁用,但该选项应跟在其它选项后面,例如可以启用--quote-names的--compatible。 Quote identifiers within backtick characters  
--replace replace   Write REPLACE statements rather than INSERT statements 5.1.3
--result-file=file result-file 将输出转向给定的文件。该选项应用在Windows中,因为它禁止将新行‘\n’字符转换为‘\r\n’回车、返回/新行序列。 Direct output to a given file  
--routines routines 在转储的数据库中转储存储程序(函数和程序)。使用---routines产生的输出包含CREATE PROCEDURE和CREATE FUNCTION语句以重新创建子程序。但是,这些语句不包括属性,例如子程序定义者或创建和修改时间戳。这说明当重载子程序时,对它们进行创建时定义者应设置为重载用户,时间戳等于重载时间。 如果你需要创建的子程序使用原来的定义者和时间戳属性,不使用--routines。相反,使用一个具有mysql数据库相应权限的MySQL账户直接转储和重载mysql.proc表的内容。 该选项在MySQL 5.1.2中添加进来。在此之前,存储程序不转储。 Dump stored routines (procedures and functions) from the dumped databases 5.1.2
--set-charset set-charset 将SET NAMES default_character_set加到输出中。该选项默认启用。要想禁用SET NAMES语句,使用--skip-set-charset。 Add SET NAMES default_character_set to the output  
--single-transaction single-transaction 该选项从服务器转储数据之前发出一个BEGIN SQL语句。它只适用于事务表,例如InnoDB和BDB,因为然后它将在发出BEGIN而没有阻塞任何应用程序时转储一致的数据库状态。 当使用该选项时,应记住只有InnoDB表能以一致的状态被转储。例如,使用该选项时任何转储的MyISAM或HEAP表仍然可以更改状态。 --single-transaction选项和--lock-tables选项是互斥的,因为LOCK TABLES会使任何挂起的事务隐含提交。 要想转储大的表,应结合--quick使用该选项。 This option issues a BEGIN SQL statement before dumping data from the server  
--skip-add-drop-table skip-add-drop-table   Do not add a DROP TABLE statement before each CREATE TABLE statement  
--skip-add-locks skip-add-locks   Do not add locks  
--skip-comments skip-comments   Do not add comments to the dump file  
--skip-compact skip-compact   Do not produce more compact output  
--skip-disable-keys skip-disable-keys   Do not disable keys  
--skip-extended-insert skip-extended-insert   Turn off extended-insert  
--skip-opt skip-opt   Turn off the options set by --opt  
--skip-quick skip-quick   Do not retrieve rows for a table from the server a row at a time  
--skip-quote-names skip-quote-names   Do not quote identifiers  
--skip-set-charset skip-set-charset   Suppress the SET NAMES statement  
--skip-triggers skip-triggers   Do not dump triggers  
--skip-tz-utc skip-tz-utc   Turn off tz-utc 5.1.2
--ssl-ca=file_name ssl-ca   The path to a file that contains a list of trusted SSL CAs  
--ssl-capath=dir_name ssl-capath   The path to a directory that contains trusted SSL CA certificates in PEM format  
--ssl-cert=file_name ssl-cert   The name of the SSL certificate file to use for establishing a secure connection  
--ssl-cipher=cipher_list ssl-cipher   A list of allowable ciphers to use for SSL encryption  
--ssl-key=file_name ssl-key   The name of the SSL key file to use for establishing a secure connection  
--ssl-verify-server-cert ssl-verify-server-cert   The server's Common Name value in its certificate is verified against the host name used when connecting to the server  
--tab=path tab 产生tab分割的数据文件。对于每个转储的表,mysqldump创建一个包含创建表的CREATE TABLE语句的tbl_name.sql文件,和一个包含其数据的tbl_name.txt文件。选项值为写入文件的目录。 默认情况,.txt数据文件的格式是在列值和每行后面的新行之间使用tab字符。可以使用--fields-xxx和--行--xxx选项明显指定格式。 注释:该选项只适用于mysqldumpmysqld服务器在同一台机器上运行时。你必须具有FILE权限,并且服务器必须有在你指定的目录中有写文件的许可。 Produce tab-separated data files  
--tables tables 覆盖---database或-B选项。选项后面的所有参量被看作表名。 Override the --databases or -B option  
--triggers triggers 为每个转储的表转储触发器。该选项默认启用;用--skip-triggers禁用它。 Dump triggers for each dumped table  
--tz-utc tz-utc   Add SET TIME_ZONE='+00:00' to the dump file 5.1.2
--user=user_name user 连接服务器时使用的MySQL用户名。 The MySQL user name to use when connecting to the server  
--verbose   冗长模式。打印出程序操作的详细信息。 Verbose mode  
--version   显示版本信息并退出。 Display version information and exit  
--where='where_condition' where 只转储给定的WHERE条件选择的记录。请注意如果条件包含命令解释符专用空格或字符,一定要将条件引用起来。 Dump only rows selected by the given WHERE condition  
--xml xml   Produce XML output  

博客新面孔

Category : 技术生活

Comments : 暂无评论

Author : qpwoeiru96

DateTime : 2012/01/11

Tags : none

今天花了整整一天时间来优化了下博客,自制了个新的自适应宽度的模版,采用了一些CSS3的效果,基本上IE8+通过的,IE6,7之类的就不入发眼了。

不知道为什么,今天博客的速度特别好,基本上是秒开的。即使我登陆SSH延迟也不是很大。

为后台添加了编辑器,以及语法高亮的东西,前台添加了评论验证码。

当然还不是很完善,还需要好好修改,比如添加一个HTML5的幻灯片样式的上一篇下一篇,这是我下一步想搞的。

Web产品设计 - 文摘

Category : 技术生活

Comments : 暂无评论

Author : qpwoeiru96

DateTime : 2012/01/09

Tags : Web,设计,文摘

http://www.webppd.com/thread-988-1-1.html 反Box的布局设计方式 Box布局:

  1.  UI中多出了太多在使用中没有用的框框线线。
  2.  不论什么内容都放在矩形块里,即形不成阅读重点,又不利于对页面内容的识别。
  3. 造成审美疲劳,形式大同小异,缺少页面创意表现。 留白、隔断、阴影、淡变

http://www.webppd.com/thread-987-1-1.html 7±2原则对于页面布局的意义

7±2原则,即“由于人类大脑处理信息的能力有限,它会将复杂信息划分成块和小的单元。根据乔治A米勒(George A. Miller)的研究,人类短期记忆一般一次只能记住5-9个事物。”(神奇的7±2、米勒的研究)

这对于页面布局的直接指导意义如下:

  1. 一个页面总体的信息量不宜过多,提供给用户识别的区块最好不超出这个数字范围太多。
  2. 该页面需要完成的主体功能,放在页面首要主体位置。其它必须功能放在次之位置。
  3. 不要让那些有必要而非必须的功能,因为自身利益的需要,强行抢占主体位置, 以致影响人们对最熟悉、最常用的功能使用。

http://www.axure.org/grid/ 网页栅格系统模板

http://www.missyuan.com/thread-476271-1-1.html 交互设计师常用的网页设计模式

MagicASP:ASP文件统一URL,自动合并工具

Category : 技术生活

Comments : 暂无评论

Author : qpwoeiru96

DateTime : 2012/01/05

Tags : ASP

MagicASP 一个ASP文件自动合并工具用于统一URL.最终使用MagicASP生成的ASP文件形式如下:http://www.example.com/?m=arcitle&a=read&id=1 当然好处不止如此,细细体会吧。 点击下载

MagicASP 目录结构:
    application 
        ┣   index.asp   file
        ┣   Magic.asp   file
        ┣   action      directory    
            ┗   index   directory
                ┗   index.asp   file
        ┣   module      directory    
            ┣   index.asp       file
        ┣   runtime     directory    
        ┗   view        directory    
            ┗   index.html      file

阅读剩余部分...

LESS文件生成CSS自动化

Category : 技术生活

Comments : 暂无评论

Author : qpwoeiru96

DateTime : 2012/01/04

Tags : nodejs,LESS

直接上代码 Build.js

var path = require('path'),
    fs = require('fs'),
    sys = require('util'),
    less = require('../less');
 
var less_file = process.argv[2] ;
 
process.chdir( path.dirname( less_file ) );
 
if( typeof less_file  === 'undefined' ) {
    console.log('UNDEFINED LESS FILE');
    process.exit(0);
}
 
var target_file = typeof( process.argv[3] ) === 'undefined' ? path.basename( less_file , path.extname( less_file ) ) + '.css' : process.argv[3] ;
 
var target_folder = path.dirname( target_file ) === '.' ? path.dirname( less_file ) : path.dirname( target_file );
 
fs.readFile(less_file, 'utf8', function (e, data) {
 
    var tree, css;
 
    new(less.Parser)({ optimization: 2 }).parse(data, function (err, tree) {
 
        css = tree.toCSS();        
        css = css.replace( /\r|\n/ig , '' ); //去除换行及回车
        css = css.replace( /\/\*[\w\W]*?\*\//ig , ''); //去除注释
        css = css.replace( / {2,}/ig , ' '); //去除多余空格
 
        var css_file = target_folder + '/' + path.basename( target_file ) ;
 
        fs.writeFile( css_file , css , function (err) {
            if (err) throw err;
            console.log('BUILT SCUCCESS');
        });
       
 
        if (err) {
            less.writeError(err);
            process.exit(0);
        }
 
    });
 
});

Build.Cmd

@echo off
%~d0
cd %~dp0
cd less
node.exe build.js %1 %2

点击下载 说明:.less文件直接拉到Build.cmd 即可在less文件目录下生成相同文件的.css 自动去除多余空格 回车换行 注释。保证最小化

LG P970 资源

Category : 技术生活

Comments : 暂无评论

Author : qpwoeiru96

DateTime : 2011/12/31

Tags : P970,Android

  1. http://forum.xda-developers.com/showthread.php?t=1167075 : ADW Themes
  2.  http://forum.xda-developers.com/showthread.php?t=1386744 : 时间居中 跟 状态栏透明
  3.  http://forum.xda-developers.com/showthread.php?t=1189723 : ADW 高仿MIUI主题
  4.  http://forum.xda-developers.com/showthread.php?t=1102755 : ADW 高仿MEIZU主题