Skip to content
AI NEWS JOURNAL
AI, IN PERSPECTIVE

Search AI news

Search headlines, summaries and articles to connect the dots.

Newest first

Show HN: String#to_proc` to Help Traversing JSON

I've resuscitated a project I was working on years ago.I was tired of having nested `flat_map` making my code basically unreadable just to fetch a simple value. The idea is to make simple & readable the traversing of deeply nested structures like JSON responses, while staying in Ruby & keeping its flexibility. Here it goes: graphql_response.then(&'[data][repository][issues][edges]*([node][title])') # => ["Support negative indexes", "Document aggregates"] github_prs_response.then(&'*[draft].any?') # => true It's different from jq or JSONPath in that: - it's a Ruby block so you can use it with `map`, `find`, etc. - you can call Ruby method from it - it doesn't automatically flatten arrays, you decide - it raises on `nil` by default (unless you use `&`, i.e. `[customer][address]&[city]`)Obviously, it has drawbacks: - it's yet another syntax to learn - it monkey-patches `String` which might be a blocker for someI'm really looking for feedback here, what do you think? Is it worth releasing a gem with this value proposition? Comments URL: https://news.ycombinator.com/item?id=50491929 Points: 2 # Comments: 0

Show HN: SrcWranglr

I spend a lot of time diving deep into C/C++ code bases for various reasons. Normally for Vulnerability Research. I like to get a good feel for the software, it's data structures, control flow, etc. Are all usually important.In the past we have SourceTrail, this is now defunct and its abilities were somewhat limited. If you have thousands to spend you can grab a Understand license... Wait maybe thats SourceNavigator. Either way I wrote SrcWranglr. Its my very first Rust project (congrats to the insufferable Rusteans, I finally cracked and learned Rust).Anyhow SrcWranglr is wicked free, wicked fast, has a modern UI, and features that assist in finding bugs/vulns. You can run semgrep rules over the codebase, or have a fuzz harness generated for you by the program with ease.. Its still super early in development but it already helped me discover a 0day :-).. Give it a shot if you want. I am open to any suggestions and if it is in your heart to contribute let me know. I only get to work on personal projects here and there on account of work... But yea enough babbling.https://github.com/jdefrancesco/SrcWranglr Comments URL: https://news.ycombinator.com/item?id=50380536 Points: 1 # Comments: 0