Giter Site home page Giter Site logo

Comments (7)

prachaquanttech avatar prachaquanttech commented on August 28, 2024

Update
if I remove properties, cacheSize and poolSize from the config, Code will run fine.

from device-detection.

JoshGrew51D avatar JoshGrew51D commented on August 28, 2024

Hi There

You should only need to remove poolSize as this is a Pattern only option. Hash Trie does not have a workset pool like Pattern. It's matches consist of Device offsets which are smaller than Pattern worksets. As a result they are calculated on the fly.

Let me know how you get on.

from device-detection.

prachaquanttech avatar prachaquanttech commented on August 28, 2024

Thanks for the answer
if add "properties" option back, It will throw "segmentation fault".

from device-detection.

JoshGrew51D avatar JoshGrew51D commented on August 28, 2024

Which version of the data file are you using currently?

from device-detection.

prachaquanttech avatar prachaquanttech commented on August 28, 2024

51Degrees-EnterpriseV3.4.trie

from device-detection.

JoshGrew51D avatar JoshGrew51D commented on August 28, 2024

Of course, sorry ignore me.

I have modified the example above with some changes to the configuration. Properties are not stored as an array but as a comma separated string. The keys in the config are also surrounded by quotes.

Try this and let me know what you get back.

Would you also be able to send over the code where you reference the Device Detection module in: DeviceDetection.provider

const fiftyonedegreescoreConfig = {'dataFile' : 'static/51degrees/51Degrees-EnterpriseV3.4.trie',
    'properties' : 'HardwareVendor,HardwareModel,HardwareFamily,PriceBand,PlatformName,PlatformVersion,ScreenPixelsHeight,ScreenPixelsWidth,ReleaseMonth,ReleaseYear,DeviceType,HardwareModelVariants'}

const provider = DeviceDetection.provider(fiftyonedegreescoreConfig)
const match =  provider.getMatch(ctx.header['user-agent'])
match.close()

from device-detection.

prachaquanttech avatar prachaquanttech commented on August 28, 2024

This code work

const fiftyonedegreescoreConfig = {'dataFile' : 'static/51degrees/51Degrees-EnterpriseV3.4.trie',
    'properties' : 'HardwareVendor,HardwareModel,HardwareFamily,PriceBand,PlatformName,PlatformVersion,ScreenPixelsHeight,ScreenPixelsWidth,ReleaseMonth,ReleaseYear,DeviceType,HardwareModelVariants'}

const provider = DeviceDetection.provider(fiftyonedegreescoreConfig)
const match =  provider.getMatch(ctx.header['user-agent'])
match.close()

BTW we use module this in Koa.js. Can I write provider.getMatch(ctx.request) like in Express.js?

Thanks a lot

from device-detection.

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.