首页 \ 问答 \ 系列算法(Algorithm for series)

系列算法(Algorithm for series)

A,B,C,.... Z,AA,AB,......。AZ,BA,BB,.... ,ZZ,AAA,...,编写一个取整数n并返回字符串表示的函数。 有人能告诉我算法找到系列中的第n个值吗?


A, B, C,…. Z, AA, AB, ….AZ, BA,BB,…. , ZZ,AAA, …., write a function that takes a integer n and returns the string presentation. Can somebody tell me the algorithm to find the nth value in the series?


原文:https://stackoverflow.com/questions/2390804
更新时间:2022-05-10 11:05

最满意答案

Clojure承诺不会失败,因为它们不依赖于特定的执行线程。 快速了解Clojure期货和承诺如何不同?

听取未来或承诺是否有办法在clojure未来结束时得到通知? 如果您不介意创建另一个线程,则会显示一个可选的选项。

其他选择是使用一些Java库,如Guava ListenableFuture,或者查看新的和花哨的core.async


Clojure promises cannot fail as they are not tied to a particular execution thread. Have a quick look at How do Clojure futures and promises differ?

For listen to either a future or a promise Is there a way to be notified when a clojure future finishes? shows a posible option if you don't mind creating another thread.

Other options is to use some Java library like Guava ListenableFuture or look at the new and fancy core.async

相关问答

更多
  • 新的易失性与真正的“变量”(就像它来自许多其他编程语言一样),因为它可以用于clojure。 从公告 : 有一组新功能( volatile! , vswap! , vreset! , volatile? )创建并使用易失性“盒子”来保持有状态换能器的状态。 挥发物比原子快,但放弃原子性保证,所以只能用于线程隔离。 例如,你可以像设置C中的变量一样设置/获取和更新它们。唯一的附加(也就是名称)是实际Java对象的volatile关键字。 这是为了防止JVM进行优化,并确保它在每次访问时都读取内存位置。 从JI ...
  • Rich Hickey(他是Clojure的设计师)评论说,这是wiki上的第一个参考链接: 你是否选择了从“关闭”一词开始的名字,并用“j”代替“s”? 这似乎很有可能,但是这样做会很好。 这个名字被选为独一无二的。 我想要涉及c(c#),l(lisp)和j(java)。 一旦我想出了Clojure,给予关闭的双关语,可用的域名和谷歌空间的空虚,这是一个容易的决定。 http://groups.google.com/group/clojure/msg/766b75baa7987850 Rich Hicke ...
  • 这是一个工作示例项目: project.clj: (defproject parse "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "http://example.com/FIXME" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies ...
  • 我认为binding宏是并行的而不是顺序的。 请参阅: http : //clojuredocs.org/clojure_core/clojure.core/binding I believe binding macro is parallel not sequential. See: http://clojuredocs.org/clojure_core/clojure.core/binding
  • 不幸的是,你已经在表达式中使用了符号对象(apply (first a) (rest a)) 。 符号对象查找自身的值作为映射中的键: ('/ {'+ :plus '/ :slash '- :minus} :not-found) => :slash ('/ {'+ :plus '$ :dollar '- :minus} :not-found) => :not-found ('/ 1 :not-found) => :not-found ('/ 1 2) => 2 Unfortunately, you ...
  • Clojure中的默认整数类型很long 。 如果你想指定一个整数文字应该被认为是一个clojure.lang.BigInt只需在该数字后面加一个N 。 (defn fib-pair [[a b]] [b (+ a b)]) (nth (map first (iterate fib-pair [1N 1N])) 500) ;= 2255915161619363308725126950360720720460113249137581905886388664184746277386868834050159870 ...
  • Clojure承诺不会失败,因为它们不依赖于特定的执行线程。 快速了解Clojure期货和承诺如何不同? 听取未来或承诺是否有办法在clojure未来结束时得到通知? 如果您不介意创建另一个线程,则会显示一个可选的选项。 其他选择是使用一些Java库,如Guava ListenableFuture,或者查看新的和花哨的core.async Clojure promises cannot fail as they are not tied to a particular execution thread. H ...
  • 如果你注释掉(deref ~q) ,那么用q传递的代码永远不会被评估,所以嵌套的期货不会存在。 宏扩展: (macroexpand '(-> (future (wait 200 (println "'Ello, gov'na!"))) (enqueue saying (wait 400 "Pip pip!") (println @saying)) (enqueue saying (wait 100 "Cheerio!") (printl ...
  • Travis CI问题跟踪器[ 1 ]和clojurians Slack进行了讨论。 原因是OpenJDK 9没有附带签署Clojars证书的证书。 Christian Stein提到Travis CI将始终提供未修补的JDK安装。 如有必要,用户需要对系统CA证书进行符号链接( 原始单词 )。 解 这是更新的最小Travis CI配置。 它涉及在before_install阶段手动对系统CA证书进行符号链接。 language: clojure lein: 2.8.1 jdk: - openjdk8 ...
  • Clojure的序列是懒惰的,但为了提高效率,一次实现了32个结果的块。 =>(def lz-seq (map #(do (println (str "fn call " %)) (identity %)) (range 100))) =>(first lz-seq) fn call 0 fn call 1 ... fn call 31 0 一旦你首先越过32边界,就会发生同样的事情 =>(nth lz-seq 33) fn call 0 fn call 1 ... fn call 63 33 对于需 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)