使用gcc我可以删除注释和不需要的空行,但我想减少文件的大小,是否有任何选项gcc或任何其他工具这样做
目前我喜欢这个
gcc -fpreprocessed -dD -E -P source_code.c > source_code_comments_removed.c
Run Code Online (Sandbox Code Playgroud)
这是场景假设这是我的source_code.c
#include <stdio.h>
main()
{
// declar variable i
int i=0;
/* multiline comment
for loop
demo stuff
*/
for(i=1; i<=5; i++)
{
// just print something
printf("Hello %d \n",i);
}
}
Run Code Online (Sandbox Code Playgroud)
我想像这样缩小,删除注释和空白行
#include <stdio.h>
main(){int i=0;for(i=1; i<=5; i++){printf("Hello %d \n",i);}}
Run Code Online (Sandbox Code Playgroud)
注意:我在Linux上请不要建议任何基于Windows的解决方案
这个问题是关于查询优化,以避免通过PHP多次调用数据库.
所以这是场景,我有两个表,其中包含您可以将其称为参考表的信息,另一个是数据表,字段key1并且key2在两个表中都是通用的,基于这些字段,我们可以加入它们.
我不知道查询是否可以比我现在正在做的更简单,我想要实现的如下:
我希望找到
key1,key2,info1,info2与main_info表不同的,每当串行值小于10并且key1,key2两个表匹配时,然后将它们info1,info2分组,而分组计数key1,key2重复的info1,info2字段和group_concat那些键的重复
表的内容 main_info
MariaDB [demos]> select * from main_info;
+------+------+-------+-------+----------+
| key1 | key2 | info1 | info2 | date |
+------+------+-------+-------+----------+
| 1 | 1 | 15 | 90 | 20120501 |
| 1 | 2 | 14 | 92 | 20120601 |
| 1 | 3 | 15 | 82 | 20120801 |
| 1 | 4 …Run Code Online (Sandbox Code Playgroud)