牛刀小试(第一部分)

真正的程序员的编程态度与偏好
博客阐述了真正的程序员的特点,如不循规蹈矩、不写注释、不写应用程序等。还提及他们不用COBOL、FORTRAN、Modula - 2等语言编程,不看使用指南、不画流程图,不用MAC机等,展现了独特的编程态度和偏好。
部署运行你感兴趣的模型镜像
 
  * Real Programmers don't write specs -- users should consider themselves
    lucky to get any programs at all and take what they get.
    翻译:真正的程序员不循规蹈矩,他们对用户说:拿到你想要的,然后滚蛋,
    你已经很幸运了!

  * Real Programmers don't comment their code. If it was hard to write, it
    should be hard to understand and even harder to modify.
    真正的程序员不写注释。难写的程序天生难以理解、难以修改。
  * Real Programmers don't write application programs; they program right down
    on the bare metal. Application programming is for feebs who can't do
    systems programming.
    真正的程序员不写应用程序。他们爱白手起家。只有不懂写系统程序的
    软弱者才写应用程序。
  * Real Programmers don't eat quiche. In fact, real programmers don't know
how
    to SPELL quiche. They eat Twinkies, and Szechwan food.
    真正的程序员不吃蛋卷。他们根本不屑也不懂拼“quiche(蛋卷)”这个词。
    他们吃twinkies和四川菜。
    注:twinkies可能是某种用两片面包片夹着的食物。
  * Real Programmers only write specs for languages that might run on future
    hardware. Noboby trusts them to write specs for anything homo sapiens will
    ever be able to fit on a single planet.
    真正的程序员只为未来机器上用的语言写标准。鬼才会相信有哪个星球会
    用他们的标准。

  * Real Programmers never program in COBOL, money is no object.
    真正的程序员不用cobol编程,金钱如粪土。
    注:不知所云!
  * Real Programmers never right justify text that will be read on a
    fixed-character-width medium.
    真正的程序员将文本写得错落有致。
  * Real Programmers wear hiking boots only when it's much too cold to wear
    sandals. When it's only too cold, they wear socks with their sandals.
    真正的程序员爱穿凉鞋,就算天气变冷,他们也只是再穿上袜子而已。
    只有寒风彻骨时,他们才会换上跑鞋。

  * Real Programmers don't think that they should get paid at all for their
    work, but they know that they're worth every penny that they do make.
    真正的程序员并不奢求取得每一分该得的钱,但任何拿到手的钱都
    问心无愧。
  * Real Programmers log in first thing in the morning, last thing before they
    go to sleep, and stay logged in for lots of time in between.
    真正的程序员每天只需记录起床后的第一件事和睡觉前的最后一件事,
    之间的一切照套模板即可。

  * Real programmers don't draw flowcharts. Flowcharts are after all, the
    illerate's form of documentation.
    真正的程序员不画流程图。流程图是文盲写的文档。
  * Real Programmers don't use Macs. Computers which draw cute little pictures
    真正的程序员不用MAC机。能画可爱的卡通的电脑是给胆小鬼用的。
  * Real Programmers don't read manuals. Reliance on a reference is the
    hallmark of a novice and a coward.
    真正的程序员不看使用指南。只有初学者和胆小鬼会百分百相信手册。
  * Real Programmers don't write in COBOL. COBOL is for gum chewing twits who
    maintain ancient payroll programs.
    真正的程序员不用cobol。cobol只能用来维护远古的工资程序。
  * Real Programmers don't write in FORTRAN. FORTRAN is for wimpy engineers
who
    wear white socks. The get excited over finite state analysis and nuclear
    reactor simulations.
    真正的程序员不写fortran程序。fortran是让畏缩的白领工程师用的。
    那些人只钟情于有限的状态分析和核反应堆模拟。
  * Real Programmers don't write in Modula-2. Modula-2 is for insecure
    analretentives who can't choose between Pascal and COBOL.
    真正的程序员不用modula-2编程。modula-2集合了pascal和cobol的缺点。
  * Real Programmers don't write in APL, unless the whole program can be
    written on one line.
    真正的程序员不写apl程序,除非他能在一行内把一个程序写完。
 

您可能感兴趣的与本文相关的镜像

Qwen-Image-Edit-2509

Qwen-Image-Edit-2509

图片编辑
Qwen

Qwen-Image-Edit-2509 是阿里巴巴通义千问团队于2025年9月发布的最新图像编辑AI模型,主要支持多图编辑,包括“人物+人物”、“人物+商品”等组合玩法

### 数据清洗中的数据去重方法 #### 使用 Pandas 进行数据去重 Pandas 是 Python 中用于数据分析的强大工具之一,提供了多种函数来帮助完成数据清理工作。其中 `drop_duplicates` 函数专门用来去除 DataFrame 或 Series 中的重复项[^1]。 以下是基于 Pandas 的数据去重示例: ```python import pandas as pd # 创建一个带有重复记录的数据框 data = { 'ID': [1, 2, 3, 4, 5, 1], 'Name': ['Alice', 'Bob', 'Charlie', 'David', 'Edward', 'Alice'], 'Age': [25, 30, 35, 40, 45, 25] } df = pd.DataFrame(data) print("原始数据:") print(df) # 去除完全相同的行 df_cleaned = df.drop_duplicates() print("\n去除完全相同行后的数据:") print(df_cleaned) # 只针对某一列进行去重 df_name_unique = df.drop_duplicates(subset=['Name']) print("\n仅保留 Name 列唯一值的数据:") print(df_name_unique) ``` 上述代码展示了如何通过指定参数 `subset` 来控制哪些列参与判断是否为重复项。 #### JSON 数据去重中应用的方法 当处理结构化程度较高的 JSON 文件时,也可以采用类似的逻辑来进行数据去重操作。例如,在读取多个 JSON 对象并将其转换为列表后,可以通过集合(Set)或者字典键的方式实现快速过滤[^3]。 这里给出一段简单例子说明这一过程: ```python import json # 模拟一组可能含有重复条目的JSON对象数组 json_data = [ {"id": 1, "name": "Product A", "price": 10}, {"id": 2, "name": "Product B", "price": 20}, {"id": 1, "name": "Product A", "price": 10} # 复制品 ] def remove_json_duplicates(json_list): seen_ids = set() # 存储已见过的对象 ID unique_items = [] for item in json_list: if item['id'] not in seen_ids: unique_items.append(item) seen_ids.add(item['id']) # 添加到集合 return unique_items cleaned_json = remove_json_duplicates(json_data) print(cleaned_json) ``` 此片段定义了一个辅助函数 `remove_json_duplicates()` ,它接受输入的是包含若干个字典形式表示的商品信息列表,并返回一个新的不含任何冗余元素的新序列。 #### R语言下的数据去重方式 除了 Python 和其生态外,另一种广泛应用于统计学领域编程环境 —— **R** 同样支持高效便捷的数据整理技术。比如借助内置包 dplyr 提供的功能即可轻松达成目标[^2]: ```r library(dplyr) # 构造样本表格 sample_df <- data.frame( id=c(1L,2L,3L,4L,5L,1L), name=factor(c('A','B','C','D','E','A')), age=integer(), stringsAsFactors = FALSE ) unique_rows <- sample_df %>% distinct() cat("After removing duplicates:\n") print(unique_rows) ``` 这段脚本首先加载必要的扩展库;接着创建实验用小型关系型表单;最后调用了管道运算符 `%>%` 配合命令 `distinct()` 完成了整个流程。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值