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

注册后推荐绑定QQ,之后方才可以使用下方的“用QQ帐号登录”。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
什么是XY问题?0 Y# Q7 e1 K7 C& i
3 h- {6 i& X* ?0 W# i
XY问题是关于正在尝试的解决方案,而不是实际的问题。无论是对于寻求帮助的一方,还是提供帮助的一方,这都会造成大量时间、精力的浪费。
# ^6 b6 l( F. j# ^. d) f- o- |1 a& s. z1 h3 o) d. ~$ V
- 用户想做X。
- 用户不知道怎么做X,但觉得如果能做到Y,就能摸索出解决方案。
- 用户也不知道怎么做Y。
- 用户请求对问题Y的帮助。
- 其他人试图帮助用户解决Y,但却感到困惑,因为尝试解决Y似乎是个奇怪的问题。
- 经过大量互动和浪费的时间后,终于发现用户其实需要X方面的帮助,而Y甚至不是对X的合适解决方案。: Q2 K3 B. D1 [6 O, v H+ d
' z0 l6 l$ Z7 Z9 u' }
当人们被自认为的解决方案卡住,无法退一步完整解释问题时,问题就出现了。
( K+ u; I; F! ?- C2 g
! A* }9 B+ V5 I& O4 ^1 q* W7 c示例
( l# y! T: e- w. Y0 }
2 W$ G" l, t3 e9 t4 [. L0 \3 L示例1
3 J- A( Y. p5 D, ]' Z! |n00b实际上不想要文件名中的最后3个字符,而是想要获取文件扩展名,为什么要问最后3个字符?
0 j* }4 y, t' S$ i0 P- <n00b> How can I echo the last three characters in a filename?- S6 p4 W/ N4 C' D/ U4 k8 b
- <feline> If they're in a variable: echo ${foo: -3}, O9 R0 ~4 d1 v( Q
- <feline> Why 3 characters? What do you REALLY want?; j4 g' s* @% I4 D) }6 x" L* i
- <feline> Do you want the extension?
, n4 L$ U' ^; f# G! B* Y - <n00b> Yes.
8 I' ?6 A7 h z9 _/ U/ S% G+ R% _) z - <feline> There's no guarantee that every filename will have a three-letter extension,) w0 a: w6 G* ]3 A1 p/ p
- <feline> so blindly grabbing three characters does not solve the problem.
0 z6 S! n% G. M6 }: a8 S - <feline> echo ${foo##*.}
复制代码
+ X* i9 [0 k- s- g4 }9 a5 _3 h8 F示例2
+ ^# z1 ]8 _% V% c3 l6 i如果Angela一开始就解释她想防止别人发现她的操作系统,可能讨论会更短、更有成效。
% g4 x# O/ W# p2 B% L6 h: a4 r1 }- Angela: 'nmap -O -A 127.0.0.1' returns some lines starting with 'OS:'. How to change it?" R$ c* o1 \8 I) j6 D$ T- g
- 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.
: e; A- ?7 h4 O! f( w3 c - Angela: Yeah, but I don't know about linux system api at all.4 ]# I9 p" q+ o' S% S- c2 w; _! B G
- 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.
1 P$ M/ S$ L' N4 E - Angela: I really need to avoid these messages. Can iptables do this work?
# K* n. {0 D# d - Obama: Well, don't use OS detection or version scanning
" J) O/ _9 Q: a( }5 K9 u - Angela: I want to prevent others from knowing the type of my OS
复制代码 中文出处:https://segmentfault.com/a/1190000044541188: y9 E$ m9 g' ]$ l' `
英文出处:https://xyproblem.info/ |
|