我
正在
使用
基本
SED
表达: -
sed -n "am/,/sed/p"
Run Code Online (Sandbox Code Playgroud)
获取"am"和"sed"之间的文本,它将输出"am \n using \n basic \n sed".但我真正的问题是如果字符串是: -
我
正在
使用
基本的
grep
表达式.
我在这句话中应用了上面的sed然后它给了"我用\n基本\n grep \n表达式",它不应该给它.如果没有匹配,如何丢弃输出?
有什么建议?
我有一个包含在类路径中的目录中的文件.看起来像这样pl/shenlon/io/gui/appData/file.txt
.现在,当我尝试将其转换为文件并使用以下代码阅读时:
File cityNamesFile = new File(ClassLoader.getSystemResource("pl/shenlon/io/gui/appData/list.txt").toURI());
Scanner cns = new Scanner(cityNamesFile);
Run Code Online (Sandbox Code Playgroud)
我得到以下内容: -
error - java.lang.IllegalArgumentException: URI is not hierarchical.
我该如何解决这个问题?
我试图在tcl中以表格格式打印数据.假设我有三个数组: -
GOLD, TEST, DIFF
它有一些价值.我想以下列格式打印: -
GOLD TEST DIFF
----------- -------- ---------
1 Hello Hi
2 Stack Format
3个用于
4个TCL打印的人
你们想建议一下吗?
haduser@user-laptop:/usr/local/hadoop$ bin/hadoop dfs -copyFromLocal /tmp/input
/user/haduser/input
11/12/14 14:21:00 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:54310. Already tried 0 time(s).
11/12/14 14:21:01 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:54310. Already tried 1 time(s).
11/12/14 14:21:02 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:54310. Already tried 2 time(s).
11/12/14 14:21:03 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:54310. Already tried 3 time(s).
11/12/14 14:21:04 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:54310. Already tried 4 time(s).
11/12/14 14:21:05 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:54310. …
Run Code Online (Sandbox Code Playgroud) 我正在使用 grep 来计算文件 graph.tcl 中字符串“^mj”的出现次数。我写的命令很简单,你很容易理解。
grep "^mj " mjwork/run/graph.tcl | | grep "^mj " mjwork/run/graph.tcl | 厕所-l
它输出46625
但之后~45 min
。你们能建议一个更好的方法来减少时间吗?
我想使用 gcov 和 lcov 生成覆盖率报告。
到目前为止我所做的:-
1. I compiled my code using --fprofile-arcs and -fprofile-coverage in
g++.
2. I have linked using lcov.
3. I have .gcno files with th e.o location.
4. When I execute binary, it is resulting into .gcda files.
Run Code Online (Sandbox Code Playgroud)
我必须做什么:-
我必须使用这些数据文件 (.gcda),并希望使用 lcov 创建一个干净的报告。
问题:-
有多个目录,其中有源文件,并且在每个目录中我创建一个 obj/ARCH 目录来保存目标文件。
因此最终的目录结构将是:-
proto ----> MJ1 ----> MJ2 ----> MJ3 ----> MJ4 ----> MJ5
MJ1 ----> .cpp
----> obj/linux/*.o *.gcno *.gcda
MJ2 ----> .cpp
----> obj/linux/*.o *.gcno …
Run Code Online (Sandbox Code Playgroud) 我尝试用-fprofile-arcs
&运行gcov -ftest-coverage
而没有用于链接.
它给出了这个错误: -
hidden symbol `__gcov_init' in /home/mojave/tools/gcc-4.4.1/amd64/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.4.1/libgcov.a(_gcov.o) is referenced by DSO
Run Code Online (Sandbox Code Playgroud)
和程序退出.
命令编译 -
bsub -g /mojave/build/"DummyDate" -J compile-obj/linux24rhel3_x86_64_GCOV64/DXp.o -I -q DFM -S 8192 -R "(model==OPTERON_250)" '/usr/bin/time --format=" ...finished DXp [`hostname`] [%E s with %P CPU]" /home/mojave/tools/gcc-4.4.1/amd64/bin/g++ -fPIC -Wall -Wno-deprecated -DTCL_8_5 -m64 -march=opteron -DLITTLE_ENDIAN_PLATFORM -DARCH=amd64 -DARCH_amd64 -DARCH_BITS=64 -DARCH_BITS_64 -fsigned-char -msse3 -D__DISABLE_MULTITHREAD__ -D_CPP_NUMERIC_LIMITS -mfpmath=sse,387 -mmmx -m3dnow -pipe -Dgcc -DLICENSE_ALWAYS_GOOD -I/home/mojave/tools/flexlm/include/v8.4 -DNO_SUPPORT_STABIE -DGCOV -I../dxpclient -I/home/mojave/tools/bzip2-1.0.2/amd64/include -I/home/mojave/tools/zlib-1.2.3/amd64/include -I/home/mojave/tools/tcltk8.5.2/amd64//include -I/home/mojave/tools/tcltk8.5.2/amd64//include -g -fprofile-arcs -ftest-coverage -DBUILD_DATE=\""UNSET"\" -DVERSION_NUMBER=\"Dum.Dum.Dum.Dummy\" -DEXT_VERSION_NUMBER=\"Dum.Dum.Dum.Dummy\" -DLAST_RELEASE_VERSION=\"1.1614\" -Wreturn-type -DTCL_8_5 …
Run Code Online (Sandbox Code Playgroud) 我有一个内置的网站,.php
但我们已经.html
使用"mod rewrite"将其转换为.使用的mod重写代码.htaccess
是
RewriteEngine on
RewriteRule ^(.*)\.html$ $1.php
Run Code Online (Sandbox Code Playgroud)
现在问题是我的网站出现在.php
和.html
.
例如:www.mydomain.com/index.html
还有www.mydomain.com/index.php
.
据我所知,它不利于搜索引擎的目的,也可能是搜索引擎的重复内容.
所以我想只保留.html [not .php]
搜索引擎和用户的网址.
怎么做?
我正在编写以下命令来解压缩makefile中的文本: -
@awk '/Exported Layer/,/Total Polygons/' out_compare.err | perl -lane '$el=$F[3] if(/Exported Layer/); print "$el: $f[3]" if (/Total Polygons/);' | cat
Run Code Online (Sandbox Code Playgroud)
但它给出了以下错误: -
如果"执行-e由于编译错误而中止,则无法修改-e第1行中标量赋值中的常量项".
你们想建议一下吗?:-)
如何在tcl中检查文件是否存在但为空?我的意思是是否存在任何等效的命令,例如if [ -s <file-name> ]
在 shell 中?
我使用的目录结构如下: - proto08/qa08/short/drc/cases/hello/win
我正在运行一个存储在"短"目录中的perl文件.perl行正在解析"win"目录上的文件.正在解析的文件使用一行: - source ../../master.txt.
我发现文件名是使用正则表达式"../../master.txt",我也想解析"../../master.txt".
我怎样才能做到这一点?有什么建议?
我正在尝试使用汇编程序版本6.1在aix6.1上使用g ++ 4.6.1编译c代码.
编译因以下原因而失败: -
line 3954495: 1252-171 The displacement must be greater than or equal to
-32768 and less than or equal to 32767.
line 3955281: 1252-171 The displacement must be greater than or equal to
-32768 and less than or equal to 32767.
line 3955395: 1252-171 The displacement must be greater than or equal to
-32768 and less than or equal to 32767.
line 3955401: 1252-171 The displacement must be greater than or equal to
-32768 and less …
Run Code Online (Sandbox Code Playgroud)