TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

How to write a cell address encoder in ruby

1 点作者 amiralles超过 6 年前

1 comment

DarkWiiPlayer超过 6 年前
A class that has 2 methods and no state whatsoever. This is exactly why I don&#x27;t like much of the ruby code out there.<p>EDIT:<p>Correct me if I&#x27;m wrong, but spreadsheet column addresses are basically just base-26 encoded numbers, where the digits are &#x27;A&#x27;...&#x27;Z&#x27;. If you convert them into their base-2 representation, you could store 65536 rows, instead of the 26*26=676 you can store with two integers.<p>An additional consideration would be that spreadsheets are often of fixed width and grow downwards, so you can use more bits for indexing rows than columns. This depends on the use-case though.
评论 #18121614 未加载