Git Product home page Git Product logo

Comments (4)

Smurf81 avatar Smurf81 commented on August 11, 2024

sorry i find the solution

from hdf5.node.

rimmartin avatar rimmartin commented on August 11, 2024

javascript does not have all 64 bits; the number is internally stored as a double which truncates the bits

I have a wrapper for Int64 for the id's but it doesn't really appear on the javascript side

What is the now object?

Is it a scalar you want to store or a table or dataset of many timestamps?

from hdf5.node.

Smurf81 avatar Smurf81 commented on August 11, 2024

a dataset, i finally found a solution like this
`const int64 = Date.now() // 1456909977176 (00 00 01 53 36 9a 06 58)
const b = new Buffer(8)
const MAX_UINT32 = 0xFFFFFFFF

// write
const big = ~~(int64 / MAX_UINT32)
const low = (int64 % MAX_UINT32) - big

b.writeUInt32BE(big, 0) // 00 00 01 53 00 00 00 00
b.writeUInt32BE(low, 4) // 00 00 01 53 36 9a 06 58
b.type=H5Type.H5T_STD_I64BE;`

My object is not a 64 bit integer in javascript but it's stored in 64bit integer in HDF5 file

I have another question : is it possible to add Attributes to a Dataset ?

from hdf5.node.

rimmartin avatar rimmartin commented on August 11, 2024

property value pairs get written as attributes. To write them after the dataset exists I'm forgetting and will look into it.

For getting them without opening the dataset there is the getDatasetAttributes on groups and file.

https://hdf-ni.github.io/hdf5.node/tut/attributes-tutorial.html

from hdf5.node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.