找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1736|回复: 0

[建议] 提问前需搞清XY问题,提高交流效率

[复制链接]
100 分钢镚 回复本帖可获得 1 分钢镚奖励! 每人限 1 次(中奖概率 70%)
epiman 发表于 2024-7-22 23:55:18 | 显示全部楼层 |阅读模式

注册后推荐绑定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
  1. <n00b> How can I echo the last three characters in a filename?- S6 p4 W/ N4 C' D/ U4 k8 b
  2. <feline> If they're in a variable: echo ${foo: -3}, O9 R0 ~4 d1 v( Q
  3. <feline> Why 3 characters? What do you REALLY want?; j4 g' s* @% I4 D) }6 x" L* i
  4. <feline> Do you want the extension?
    , n4 L$ U' ^; f# G! B* Y
  5. <n00b> Yes.
    8 I' ?6 A7 h  z9 _/ U/ S% G+ R% _) z
  6. <feline> There's no guarantee that every filename will have a three-letter extension,) w0 a: w6 G* ]3 A1 p/ p
  7. <feline> so blindly grabbing three characters does not solve the problem.
    0 z6 S! n% G. M6 }: a8 S
  8. <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 }
  1. 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
  2. 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
  3. Angela: Yeah, but I don't know about linux system api at all.4 ]# I9 p" q+ o' S% S- c2 w; _! B  G
  4. 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
  5. Angela: I really need to avoid these messages. Can iptables do this work?
    # K* n. {0 D# d
  6. Obama: Well, don't use OS detection or version scanning
    " J) O/ _9 Q: a( }5 K9 u
  7. 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/
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

今日推荐上一条 /2 下一条

×
重塑学科基石

欢迎有闲之士完善公卫百科

值得:你的点滴投入,大家长期受益

回报:VIP会员特权,大额钢镚奖励

改名|钢镚|会员|联系我们|公卫人 ( 沪ICP备06060850号-3|沪公网安备31010402334125号 )

GMT+8, 2026-2-26 12:53 , Processed in 0.055147 second(s), 3 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表