GithubHelp home page GithubHelp logo

Comments (3)

LauraWartschinski avatar LauraWartschinski commented on June 3, 2024 1

Short answer: roughly the length in bytes.

Long answer: You can take a look at figure 11 on the next page, or you can look at the "getBlocks()" function in myutils.py. There you can see that the small focus window is marked in blue and has the length n.

What is happening there is that the focus is currently, a certain location in the sourcecode, and the next location for the focus is n bytes/characters further behind. Because the focus should always be at the start or end of a token, and not directly in the middle of a token (e.g. at the l in while), it is not exactly n bytes later, but the function nextsplit() is used to determine whether there is a character like "\n" or ":" or "=" etc that indicates the end of a token.

For a given focus, the method getcontextPos() determines the context of roughly length m (in characters) around the focus point, that is, roughly n bytes with the focus point in the middle. However, this is also done in such a way that the context starts and ends at the border of tokens, which is why it's not exactly m bytes.

https://github.com/LauraWartschinski/VulnerabilityDetection/blob/master/img/FocusBlocks.png

from vulnerabilitydetection.

lsqLoveCoding avatar lsqLoveCoding commented on June 3, 2024

I'm sorry to see your reply so late because I have been busy looking for a job during this time. Thank you very much for your so detailed explanation, now I fully understand it :) ...... By the way, 2019-nCoV virus is very serious now, be careful pls' !

from vulnerabilitydetection.

LauraWartschinski avatar LauraWartschinski commented on June 3, 2024

Great =)
No worries, I'm taking it seriously. You also take care!

from vulnerabilitydetection.

Related Issues (15)

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.