]>
git.wincent.com - hextrapolate.git/log
summary |
shortlog | log |
commit |
commitdiff |
tree
first ⋅ prev ⋅ next
Greg Hurrell [Sat, 1 Aug 2015 02:46:18 +0000 (19:46 -0700)]
Implement `convert` function
Along with some illustrative tests. More to come (will fill in the blank
`it` blocks).
Based on the technique described at:
http://www.danvk.org/hex2dec.html
Greg Hurrell [Sat, 1 Aug 2015 01:54:37 +0000 (18:54 -0700)]
Don't mutate input array in joinDigits()
`reverse()` is a nasty API. It returns the reversed array, but also
mutates it in place. Noticed while using `joinDigits()` to log stuff
while developing.
Greg Hurrell [Sat, 1 Aug 2015 01:31:22 +0000 (18:31 -0700)]
Extract joinDigits() function
Greg Hurrell [Sat, 1 Aug 2015 01:20:25 +0000 (18:20 -0700)]
Speed up multiplyDigits even more
Implement the algorithm described in the last commit message.
Greg Hurrell [Sat, 1 Aug 2015 00:56:43 +0000 (17:56 -0700)]
Speed up multiplyDigits
If we can double the length of the result in a single operation, we do.
This makes us faster for larger multipliers.
Note that I could make this even faster for really big multipliers by
employing some kind of memoization:
eg. multiply X by 1000:
- iteration 0: X + X (2X)
- iteration 1: 2X + 2X (4X)
- iteration 2: 4x + 4X (8X)
- iteration 3: 8X + 8X (16X)
- iteration 4: 16x + 16X (32X)
- iteration 5: 32X + 32X (64X)
- iteration 6: 64X + 64X (128X)
- iteration 7: 128X + 128X (256X)
- iteration 8: 256X + 256X (512X)
- iteration 9: 512X + 256X (768X) [use largest possible prev value)
- iteration 10: 768X + 128X (896X) [largest possible is smaller now)
- iteration 11: 896X + 64X (960X) [and smaller]
- iteration 12: 960X + 32X (992X) [smaller]
- iteration 13: 992X + 8X (1000X) [smaller still; note skip as well]
This might be hard to implement though. I was thinking it might call for
a heap but I don't think so; it just needs a stack, and we pop off until
we get a usable value from it.
Greg Hurrell [Sat, 1 Aug 2015 00:43:08 +0000 (17:43 -0700)]
Add multiplyDigits and friends
Greg Hurrell [Fri, 31 Jul 2015 18:23:37 +0000 (11:23 -0700)]
More setup, blinking light demo
This is a mess of things that should be committed separately, but rather
than do that I think I am just going to squash the history before
publishing. Or not. Possibly can't be bothered.
Greg Hurrell [Fri, 31 Jul 2015 17:25:54 +0000 (10:25 -0700)]
Use the right port number
I find this makes all the difference...
Greg Hurrell [Fri, 31 Jul 2015 17:22:12 +0000 (10:22 -0700)]
Pull across sinon "mock" from docvim project
Should have down this previously, but overlooked it.
Greg Hurrell [Fri, 31 Jul 2015 17:19:11 +0000 (10:19 -0700)]
Forget about jsx extensions
I don't use (and never have used) them.
Greg Hurrell [Fri, 31 Jul 2015 17:16:19 +0000 (10:16 -0700)]
Ignore built products
Greg Hurrell [Fri, 31 Jul 2015 17:11:33 +0000 (10:11 -0700)]
Replace boilerplate server.js with gulp-based runner
I want to use gulp as a uniform interface for building, running,
watching etc. This is a start.
Greg Hurrell [Fri, 31 Jul 2015 14:34:55 +0000 (07:34 -0700)]
Add `add` module
Greg Hurrell [Fri, 31 Jul 2015 13:39:59 +0000 (06:39 -0700)]
Tailor package.json metadata to match project
Greg Hurrell [Fri, 31 Jul 2015 13:32:55 +0000 (06:32 -0700)]
Add standard test tools
Greg Hurrell [Fri, 31 Jul 2015 06:12:53 +0000 (23:12 -0700)]
Boostrap using react-hot-boilerplate
I am too lazy to figure out how to use Webpack etc, so just using this
minimal boilerplate as a starting point:
https://github.com/gaearon/react-hot-boilerplate.git
This corresponds to the current HEAD of the master branch (commit
f66496ab2f068150fbeb7c95bb137e06e1a02b47 ).
Greg Hurrell [Fri, 31 Jul 2015 04:02:48 +0000 (21:02 -0700)]
Create new unparented branch for JavaScript implementation
Getting this ancient codebase building on Yosemite is going to be more
trouble than it's worth (Xcode has changed too much, and GMP was always
hard to compile at the best of times), so let's rebuild this in
JavaScript as a web app.