- 积分
- 366758
好友
记录
日志
相册
回帖0
主题
分享
精华
威望 旺
钢镚 分
推荐 人
|

注册后推荐绑定QQ,之后方才可以使用下方的“用QQ帐号登录”。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
什么是XY问题?3 [; ^% ]- k7 Z" l1 F6 U
( e6 R% X Z: g( aXY问题是关于正在尝试的解决方案,而不是实际的问题。无论是对于寻求帮助的一方,还是提供帮助的一方,这都会造成大量时间、精力的浪费。3 c+ l. W3 F+ Z' J4 v+ k( o7 M3 r
! I7 r4 ?! E+ c- 用户想做X。
- 用户不知道怎么做X,但觉得如果能做到Y,就能摸索出解决方案。
- 用户也不知道怎么做Y。
- 用户请求对问题Y的帮助。
- 其他人试图帮助用户解决Y,但却感到困惑,因为尝试解决Y似乎是个奇怪的问题。
- 经过大量互动和浪费的时间后,终于发现用户其实需要X方面的帮助,而Y甚至不是对X的合适解决方案。: I i6 V& ^: o
8 f# w; S2 G% b& y/ `1 F- P当人们被自认为的解决方案卡住,无法退一步完整解释问题时,问题就出现了。, [" {( M2 P( i9 q6 B6 o8 n6 `1 r
/ }! o! q1 r5 M6 ?
示例
9 o0 ]9 E2 X" K( \1 J6 I' D4 s* G+ x, v+ A& `. G
示例1
2 x$ \' l$ \& n& p G, M5 i4 K8 X4 qn00b实际上不想要文件名中的最后3个字符,而是想要获取文件扩展名,为什么要问最后3个字符?. x& H% E/ t! i+ s7 y
- <n00b> How can I echo the last three characters in a filename?8 y8 ^: ~, q* o1 k7 [/ d
- <feline> If they're in a variable: echo ${foo: -3}
) B0 \5 r& B- d k5 D - <feline> Why 3 characters? What do you REALLY want?6 g& Q, Y6 V) V% t0 Y: \3 Y
- <feline> Do you want the extension? j6 j' r, n' P* u' e. w
- <n00b> Yes.
+ e2 k3 W) ]" Z; }6 D$ i5 t5 b - <feline> There's no guarantee that every filename will have a three-letter extension,
/ x0 \+ }4 X9 S - <feline> so blindly grabbing three characters does not solve the problem.$ U6 r/ Q4 h* I) H7 y$ N9 ~6 U$ |
- <feline> echo ${foo##*.}
复制代码
$ `5 W8 s) _* W7 M" h: V示例2
( S7 ?( \- G0 f, p% ]如果Angela一开始就解释她想防止别人发现她的操作系统,可能讨论会更短、更有成效。
2 ~* i! j% d$ Y: \- Angela: 'nmap -O -A 127.0.0.1' returns some lines starting with 'OS:'. How to change it?
# a# t" F4 i+ ^5 c# T5 y3 a z - Obama: Look in the sourcecode for nmap, find how it figures out the Linux part, then rewrite your TCP/IP stack to not operate in a way nmap can detect.5 ]" J$ n0 {* I; _. ^9 X+ G* {
- Angela: Yeah, but I don't know about linux system api at all.
' I$ y! j9 n# Q0 C$ C( a/ S - Obama: Well, nmap's fingerprint is based on the way the TCP/IP stack works, there's no real way except to rewrite the appropriate parts of said stack.
9 U5 U# ^/ d% \ - Angela: I really need to avoid these messages. Can iptables do this work?
+ H7 [6 k L: D0 Y' F Q4 X2 U - Obama: Well, don't use OS detection or version scanning( H6 ? s0 Q* |( p/ m0 U2 h1 ?- F: x
- Angela: I want to prevent others from knowing the type of my OS
复制代码 中文出处:https://segmentfault.com/a/1190000044541188
5 }7 K! Y5 ?3 a( b英文出处:https://xyproblem.info/ |
|