This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This class is an illustration of using loan pattern(a.k.a lender-lendee pattern) | |
* @author prassee | |
*/ | |
public class IOResourceLender { | |
/** | |
* Interface to write data to the buffer. Clients using this | |
* class should provide impl of this interface | |
* @author sysadmin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; Author: Abhishek Mishra <ideamonk@gmail.com> | |
; ; http://www.reddit.com/r/dailyprogrammer/comments/zfeb2/9062012_challenge_96_intermediate_parsing_english/ | |
; ; seven hundred and fourty-four million | |
; (-> 7 (* 100) (+ 40 4) (* 1000000) ) | |
; ; ten-million and ninety-four | |
; (-> 10 (* 1000000) (+ 90 4) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package | |
{ | |
public class NumberUtil | |
{ | |
//Usage: trace(NumberUtil.converToWords(numbers.text)); | |
private static const THOUSANDS:Array = ['','Thousand','Million','Billion','Trillion']; | |
private static const DECADES:Array = ['Twenty','Thirty','Forty','Fifty','Sixty','Seventy','Eighty','Ninety']; | |
private static const TENS:Array = ['Ten','Eleven','Twelve','Thirteen','Fourteen','Fifteen','Sixteen','Seventeen','Eighteen','Nineteen']; | |
private static const DIGITS:Array = ['Zero','One','Two','Three','Four','Five','Six','Seven','Eight','Nine']; | |
private static const HUNDRED:String = 'Hundred '; |