V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  bfdh  ›  全部回复第 15 页 / 共 25 页
回复总数  493
1 ... 11  12  13  14  15  16  17  18  19  20 ... 25  
2021-08-19 17:36:20 +08:00
回复了 woshichuanqilz 创建的主题 C++ cpp 有什么简洁的方案可以时间 http 请求吗?
curl --libcurl 甚至能帮你把 demo 写了。
2021-08-19 10:39:24 +08:00
回复了 huangya 创建的主题 Linux 编译完的内核如何快速删除没有编译的.c 文件
#!/bin/bash
set -e
#set -x

#脚本说明
#该脚本用于在编译后的 Linux Kernel 目录中找出实际编译的全部.c 文件及其依赖的.h 文件,
#并将结果保存在 files.list 中,可直接导入到 sourceinsight 。
#执行方法:将脚本放到 Linux Kernel 编译目录直接执行即可。

TMPDIR=`mktemp -d`
MASTERDIR="$PWD"
OCMDFILE=$TMPDIR/file.ocmd
TFILE=$TMPDIR/file.t
AFILE=$TMPDIR/file.a
BFILE=$TMPDIR/file.b
CFILE=$TMPDIR/file.c
DFILE=$TMPDIR/file.d
HFILE=$TMPDIR/file.h

function get_header_file_from_ocmd()
{
local prefix=$(echo $MASTERDIR/ | sed 's/\//\\\//g')
oc=$1 #name of input file,input file is mixed content of all .o.cmd file
out=$2 #name of output file

echo "handle ocmd file $oc for header file"

grep -E "\.h)?$" $oc > $out
sed -i -e 's/\.h)$/.h/g' -e "s/^\([^\/]\)/${prefix}\1/g" $out

echo "handle ocmd file $oc for header file done"
}

function merge_result()
{
cat $@ > files.list

echo All .c and .h files are listed in files.list, now you can import them to sourceinsight project.
}

function get_defination_from_ocmd()
{

oc=$1 #name of input file,input file is mixed content of all .o.cmd file
out=$2 #name of output file

echo "handle ocmd file $oc for defination"
rm -fv $out

sort -u $oc > $out
cp -v $out $oc

grep "\-\bD" $oc |awk -F' ' '{for(i=1;i < NF;i++)printf("%s\n", $i);}' |grep "\-\bD"|sed -e "s/\-D/\#define\ /g" -e "s/=/\ /g" -e '/KBUILD_/'d | sort -u > $out

echo "handle ocmd file $oc for defination done"
}

find -name "*.o.cmd" | sed -e '/\.mod\./'d -e '/\.built-in\./d' > $OCMDFILE #no ".*.modmake -j24.cmd" and ".built-in.o.cmd"
cat $OCMDFILE | awk -F '.' '{printf("%s%s%s.c\n", "'$MASTERDIR'", $2, $3)}' > $TFILE #add $MASTERDIR to the start of line
sort -u $TFILE > $CFILE
echo "System:List of C file is in $CFILE"

echo "Mix content of all .o.cmd file"
while read line; do
cat $line
done < $OCMDFILE >> $AFILE
echo "Mix content of all .o.cmd file,done,$counts files has been handled"

echo "Genrate defination file"
cp -v $AFILE $BFILE

get_defination_from_ocmd $BFILE $DFILE
echo "Genrate defination file,done"
echo "System:List of D file is in $DFILE"

echo "Put all unit of information to single line mode"
sed 's/\ /\n/g' $AFILE > $TFILE
echo "Put all unit of information to single line mode,done"

echo "Sort and Uniq all unit of information"
sort -u $TFILE > $AFILE
echo "Sort and Uniq all unit of information,done"

echo "Get all name of header file"
get_header_file_from_ocmd $AFILE $TFILE
echo "Get all name of header file,done"

echo "Sort and Uniq all name of header file"
sort -u $TFILE > $AFILE
echo "Sort and Uniq all name of header file,done"

echo "Delete the name of header file of host"
sed '/^\/usr/d' $AFILE > $HFILE #delete line which start with "/usr",it's host's header file
echo "Delete the name of header file of host,done"

echo "System:List of H file is in $HFILE"

merge_result $CFILE $HFILE

rm -fr $TMPDIR


补充:如果不删 TMPDIR,还可以在 file.d 文件中查看通过命令行 /Makefile 传递进去的宏定义。
2021-08-18 16:22:12 +08:00
回复了 hecz 创建的主题 职场话题 工作方向选择
@zoharSoul 但是随时可能整个部门裁掉。
2021-08-17 09:14:11 +08:00
回复了 biubiuGolang 创建的主题 奇思妙想 找几个闲不下来的人,组个团队,做点有趣的东西
想做一个 ed2k 的下载客户端,现在的工具都太难用了。
2021-08-17 08:55:25 +08:00
回复了 czwen1993 创建的主题 问与答 小米净化器可以去异味么?
别想了,空气净化器只能去除颗粒物,不能去异味。
2021-08-16 10:27:13 +08:00
回复了 zzyphp111 创建的主题 程序员 软件工程师能力的相关性哪个占比更大
“工程设计能力更多像是锦上添花的能力”,我觉得这个是比代码能力更高阶的技能,不仅仅是锦上添花。
2021-08-16 09:16:03 +08:00
回复了 ztxgeol 创建的主题 路由器 x86 路由器推荐
hwnat 会经常 kernel panic,这个不是 openwrt 的锅,是 MTK 的。
2021-08-11 10:25:56 +08:00
回复了 tyhuohuo8 创建的主题 问与答 手上差不多有个首付款,关于买房,县城还是省会?
看成了有多个首付款
2021-08-09 09:35:44 +08:00
回复了 chaleaoch 创建的主题 问与答 有哪些知名的基础开源软件是用 C++写的,C++为主也算
ffmpeg
关注下,我也想知道,主要是电驴比较麻烦,其他都容易支持。
2021-08-02 10:38:39 +08:00
回复了 LokiSharp 创建的主题  WATCH 大家的八月挑战是什么?
@qbhy #40 回去看下日历,再想想?
男女主人分房睡,优秀!
装 Win10,虚拟机装 XP,曲线救国?
2021-07-26 10:43:15 +08:00
回复了 DinoStray 创建的主题 问与答 鼓励中年人继续学习的话有哪些
自己不飞,下个蛋在窝里,让孩子飞,要脸不?
2021-07-23 14:35:16 +08:00
回复了 join 创建的主题 Windows 最近折腾 hyper-v 的一些吐槽
@zoain #29 Win7 我没试过,不知道有没有这个问题。不过现在有点不敢用各类修改版 /精简版,还是更相信官方原版。

@sky96111 #34 我有同事用 QEMU 的,一样存在 CPU 占用高的问题。
2021-07-23 09:04:22 +08:00
回复了 join 创建的主题 Windows 最近折腾 hyper-v 的一些吐槽
@sky96111 我也是用 Linux 做主操作系统,Vbox 开 windows,但是 Vbox 经常 CPU 占用高,即使 windows 处于空闲状态。这个有解决方案吗?
2021-07-23 09:02:40 +08:00
回复了 join 创建的主题 Windows 最近折腾 hyper-v 的一些吐槽
最终我也放弃了 hyper-v 和 wsl(2),现在要么用 windows 主机+vmware,要么用 linux 主机+vbox 。
1 ... 11  12  13  14  15  16  17  18  19  20 ... 25  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1302 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 39ms · UTC 18:00 · PVG 02:00 · LAX 11:00 · JFK 14:00
Developed with CodeLauncher
♥ Do have faith in what you're doing.