this post was submitted on 19 Nov 2023
31 points (94.3% liked)

Programming

17334 readers
319 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS
 

https://github.com/ocelot-inc/ocelotgui/blob/19349c7334347eb37ef61b9694390581ea5db238/ocelotgui.cpp#L16896C5-L16896C29

I need to find this line of code based on the keywords "tnt_select" and "2^32", without specifying the repository because I'm looking for instances of the same bug in other projects. This repo is public, the file isn't obfuscated, the code is in the head of the default branch. I've tried Google, Github Code Search, Sourcegraph, and BigQuery on the Github data set. I've found a few ways to locate the .rst and .po documentation files that the bug was copied from, but none that find even this single example of it in actual source code files.

top 10 comments
sorted by: hot top controversial new old
[–] elias_griffin@lemmy.world 12 points 11 months ago (2 children)

I tried this in my Grasp account, a search engine that is pre-loaded with all the Hacker News blogs and other select technical website, and builds results in associated degrees of relations from there. It came up with 8 repos searching for:

https://usegrasp.com/search?q=github+%E2%80%9Ctnt_select%E2%80%9D+

Also I want to say, your scenario is troublesome that GitHub itself could not come up with a satisfactory answer. Strange.

[–] abhibeckert@lemmy.world 1 points 11 months ago* (last edited 11 months ago)

Also I want to say, your scenario is troublesome that GitHub itself could not come up with a satisfactory answer. Strange.

They have github.com/search, but for some reason it returns zero results... presumably it's a limitation (optimisation?) of their search index.

[–] sparr@lemmy.world 1 points 10 months ago (1 children)

Any chance you'd be willing to share those results? The site isn't accepting signups any more.

[–] elias_griffin@lemmy.world 1 points 10 months ago (1 children)

Looks like things at Grasp have changed dramatically and it's offline with a promise to open source the code? Did you try a symbol search while logged in, and selecting "code" or "packages" in the results filter?

https://github.com/search?q=symbol%3Atnt_select&type=code

[–] sparr@lemmy.world 2 points 10 months ago

There are a few results, but not the one I'm looking for, and none like it.

[–] _dev_null@lemmy.zxcvn.xyz 4 points 11 months ago (1 children)

Weird, clicking your link github shows me:

(Sorry about that, but we can’t show files that are this big right now.)

I can click the "raw" link, which shows the whole 32k line file, but then I don't know which line you were trying to reference.

Can you give us the specific line number(s) you were interested in?

[–] Pyro@programming.dev 8 points 11 months ago

It's line no 16896

[–] danhab99@programming.dev 2 points 11 months ago

I know Grep.app can usually do it. It couldn't find your thing

[–] ruffsl@programming.dev 1 points 11 months ago (1 children)

I'm not sure why, but GitHub's search engine, Blackbird, seems to be returning some erroneous results for this query:

Any chance you could narrow down your search to a list of repose that use the library that pulls in tnt_select() function, then clone and manually grep just those, or is it's use too common to index by?

Real funny that even narrowing down GitHub search to just the same repo doesn't help the query results:

[–] sparr@lemmy.world 1 points 10 months ago

I have considered that approach. I'd probably do it in the cloud, in parallel, maybe even in a serverless compute environment. But it does seem like a big endeavor.