Comments (7)
One potential solution, and one that I think would be preferable to browserify and create a more compact file, would be to write a node.js script that simply does a require
and then writes a JSON.stringify()
export into an output file preceded by a var numbers =
from numbers.js.
After running a few tests I can see it's not quite so easy, unfortunately. Running JSON.stringify
on something that's been required only returns an empty object.
from numbers.js.
@zikes let's see how other libraries are doing this.
from numbers.js.
The multiplatform libraries I could find used various techniques to read the individual files and combine them as strings. I made a barebones example at https://github.com/Zikes/multiplatform that we could use. Each individual component can still be required
in node.js, but the library itself ends up being a single file in public/ that can be included in either node.js or the browser. To build, run node build.js
.
from numbers.js.
Hi,
i ran into this issue while using numbers.js in my sencha touch project...
I exposed the 'require' function from browserify into global scope...then I could use 'require("numbers.js")'...
Not sure is this the correct way...But took me 2 days to get this thing working in my project...:(
@ sjkaliski ...
there might be a bug in simple matrix addition..
var array1 = [0, 1, 2];
the expected arg was = var array1 = [[0], [1], [2]];
from numbers.js.
@kagarwala That doesn't seem like a bug. I didn't write the code but the matrix object has multiple functions dealing with vectors. My assumption is that instead of writing two functions for matrix and vector addition and subtraction, the author decided to combine functionality.
Test cases here: https://github.com/sjkaliski/numbers.js/blob/master/test/matrix.test.js#L59
from numbers.js.
This issue is resolved with the pull request #118
from numbers.js.
Related Issues (20)
- Rewrite tests from random.distribution.* HOT 3
- Use Gulp instead of make HOT 3
- Duplicated method: random.sample() and statistic.randomSample()
- Fix issues found by jshint HOT 2
- can't format HOT 4
- Chi square HOT 4
- matrix.transpose doesn't work correctly on vectors HOT 2
- min / max consumes O(n) memory HOT 6
- New Organization! HOT 3
- standalone components HOT 5
- in-place operations occur in matrix.js
- add section to readme about row vector format HOT 2
- Exponential Regression Test Failing HOT 1
- use npm as a build tool instead of gulp
- Error in Documentation Link on Official NPMjs.com/packages/numbers HOT 2
- Typescript definition file HOT 1
- Request to add git tag HOT 2
- How to use number.js in simpe html file, not node dev? HOT 1
- row654 of matrix.js should insert 'm = matrix.deepCopy(m);'
- Determinant is wrong for matrix n > 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from numbers.js.