HNHacker News
TopNewBestAskShowJobs

boyter

8,192 karma · joined February 16, 2010

websites: https://searchcode.com/ https://boyter.org/ https://bonzamate.com.au/ email: ben@boyter.org twitter: @boyter
submissionscomments
boyter··on Open-Source Is Just That
Ignoring the open-source vs free software discussions that are bound to come about from this well said. Large companies exploiting developers and abuse towards the maintainers is probably my biggest bugbear when it comes to this.

In fact I have a similar post https://boyter.org/posts/the-three-f-s-of-open-source/ which I redirect people towards if they become aggressive towards me when I am trying to help them. Thankfully I have only had to use it a handful of times.

boyter··on Devs say AI crawlers dominate traffic, forcing blocks on entire countries
Crawling, incidentally, I think is the biggest issue with making a new search engine these days. Websites flat out refuse to support any crawler [other] than Google, and Cloudflare and other protection services and CDN's flat out deny access to incumbents. It is not a level playing field.

I wrote the above some time ago. I think its even more true today. Its practically impossible to crawl the way the bigger players do and with the increased focus on legislation in this area its going to lock out smaller teams even faster.

The old web is dead really. There really needs to be a move to more independent websites. Thankfully we are starting to see more of this like the linked searchmysite discussed earlier today https://news.ycombinator.com/item?id=43467541

boyter··on You suck at CSS and that's okay (2022)
For CRUD I agree. A lot of what I am doing is a bit more complex then that.

I actually would be happy to just "vibe" code my way through most of the problems I deal with if LLM's were able to do it.

That said, they make a great intern or jnr developer you can hand tasks off. You have to review either way, but the LLM does it faster.

boyter··on You suck at CSS and that's okay (2022)
I detest writing CSS and HTML. I just find it boring fiddly and annoying. I have started doing "vibe" coding with LLM's. Giving a decent prompt produces results that are... pretty good.

Almost 100% in lighthouse for both mobile and desktop, responsive, reusable components, dark/light mode and a design that was better than I could do in the 2-3 hours I spent doing it (while sipping wine).

I know its not a solution for everyone, and probably won't work for the prettier designs out there, but you can go a long way with these tools this day.

I know there is a reluctance to not use LLM's for code tasks, and I am one of the largest critics, but for me this solves a real pain point. I don't want to write CSS/HTML anymore and these tools do a good enough job of it that I don't have to.

boyter··on The secret ingredients of word2vec (2016)
TIL had no idea code2vec existed at all. Thanks for pointing it out.
boyter··on The secret ingredients of word2vec (2016)
While old, the nice thing about word2vec models is how easily they can be imported and used by any language to create a vector search.

I have always wondered (but never done anything) about if you could train on code to achieve a similar result. I suspect there could be some value there even if its just to help identify similar snippets of code.

boyter··on One Billion Nested Loop Iterations
I doubt its the GC kicking in, but you could run it with the following environment variable set just to ensure that its not doing anything.

    GOGC=-1
EDIT: Trying it out quickly shows a small improvement actually, but so small as to likely be noise as I was doing other things on the machine.

    Summary
      ./mainnogc 1000 ran
        1.01 ± 0.06 times faster than ./maingc 1000
boyter··on Counting Lines of Code
While you are right, in that you add lines to remove bugs, I suspect its still true to say given 2 projects, written in the same language by the same person, on average the one with more lines is more likely to contain more bugs.
boyter··on Counting Lines of Code
More lines of code usually indicates more bugs so its not an entirely useless metric. Using it to gauge employee productivity is, since as the linked suggests some of the better programmers are able to remove code, which often reduces the potential for bugs.

I personally find some use it in, if nothing else to identify which files probably need to be refactored as they are too large, or complex. Throw in some cyclomatic complexity and you are getting some useful information out the code counts.

Counting lines of code is one metric though. Another I have seen thrown around is ULOC https://cmcenroe.me/2018/12/14/uloc.html where you count the number of unique lines of code,

    sort -u *.h *.c | wc -l
Again another metric that potentially speaks to the health of a project. I personally wrote about this some time ago when someone asked why I wrote a code counting project https://boyter.org/posts/why-count-lines-of-code/ and I liked the idea of ULOC so much I integrated it into the project as well.

Clearly I am not alone in this though, hence there being so many code counters around (forgive me if I missed yours in the following list) and discussion around it.

    - [SLOCCount](https://www.dwheeler.com/sloccount/) the original sloc counter
    - [cloc](https://github.com/AlDanial/cloc), inspired by SLOCCount; implemented in Perl for portability
    - [gocloc](https://github.com/hhatto/gocloc) a sloc counter in Go inspired by tokei
    - [loc](https://github.com/cgag/loc) rust implementation similar to tokei but often faster
    - [loccount](https://gitlab.com/esr/loccount) Go implementation written and maintained by ESR
    - [ployglot](https://github.com/vmchale/polyglot) ATS sloc counter
    - [tokei](https://github.com/XAMPPRocky/tokei) fast, accurate and written in rust
    - [sloc](https://github.com/flosse/sloc) coffeescript code counter
    - [scc](https://github.com/boyter/scc) my own counter
Incidentally the articles author confused me for a while using standard unix tools to count code, as I had them confused for David Wheeler who wrote the very first code counter that I know of sloccount.
boyter··on Show HN: SHAllenge – Compete to get the lowest hash
I have always wanted to learn about GPU programming. Now might be the time.
boyter··on Show HN: SHAllenge – Compete to get the lowest hash
I managed to get #69 and then #42 with some Go code I repurposed since I was messing around with HashCash a while ago.

Including the code below if anyone is curious. I managed to get a 9 zero hash in under an hour on a M2 Mac Mini using it. Its only about ~3.3 MH/s which is not very impressive, but it was very easy to write.

https://gist.github.com/boyter/8600199cc6f4073dc9da380f3224f...

boyter··on DOS game “F-15 Strike Eagle II” reverse engineering/reconstruction war stories
Knights of the Sky was that WW1 flight combat game. Also a wonderful chunk of my childhood went into that. Although I found SEII to be more fun.
boyter··on DOS game “F-15 Strike Eagle II” reverse engineering/reconstruction war stories
Wow... bookmarked. F-15 Strike Eagle II is one of those games I played the hell out of as a child. So much so I wore out two joysticks that my parents bought as a result.

I was a child so it took me a long time to learn to actually do what the game wanted, and then learn after taking out the targets you got more medals by then bombing or strafing other targets. I don't think I ever got the hang of landing back on the aircraft carrier though.

boyter··on Code search is hard
Its a result of trigrams themselves. For example turning searchcode (please ignore plug, this is just the example I had to hand) goes from 1 thing you would need to index into 8.

    "searchcode"   -> [sea, ear, arc, rch, chc, hco, cod, ode]
As a result the index rapidly becomes larger than you would expect.
boyter··on Code search is hard
Yes, although the lack of detail about the sparse grams is frustrating.
boyter··on Code search is hard
You could, but I don't know what you gain out of it. The underlying index would be almost the same size, and n-gram would also allow you to search for e.t for example which you are losing in this process.
boyter··on Code search is hard
Code search is indeed hard. Stop words, stemming and such do rule out most off the shelf indexing solutions but you can usually turn them off. You can even get around the splitting issues of things like

    a.toString()
With some pre-processing of the content. However were you really get into a world of pain is allowing someone to search for ring in the example. You can use partial term search, prefix, infix, or suffix but this massively bloats the index and is slow to run.

The next thing you try is trigrams, and suddenly you have to deal with false positive matches. So you add a positional portion to your index, and all of a sudden the underlying index is larger than the content you are indexing.

Its good fun though. For those curious about it I would also suggest reading posts by Michael Stapelberg https://michael.stapelberg.ch/posts/ who writes about Debian Code Search (which I believe he started) in addition to the other posts mentioned here. Shameless plug, I also write about this https://boyter.org/posts/how-i-built-my-own-index-for-search... where I go into some of the issues when building a custom index for searchcode.com

Oddly enough I think you can go a long way brute forcing the search if you don't do anything obviously wrong. For situations where you are only allowed to search a small portion of the content, say just your own (which looks applicable in this situation) that's what I would do. Adding an index is really only useful when you start searching at scale or you are getting semantic search out of it. For keywords which is what the article appears to be talking about, that's what I would be inclined to do.

boyter··on YaCy, a distributed Web Search Engine, based on a peer-to-peer network
I actually half wrote a RFC of a spec and 2 implementations of a federated search last year. Rather than do the disturbed hash table that yacy does.

I wanted results to be re-rankable by the peers by sharing the scores that went into them. The idea being with a common protocol based on the ideas of ActivityPub you could get peers of searches working together to hopefully surface interesting things.

Something I should probably finish and publish at some point. It worked to the hundreds of peers I tested.

The reason I mention this is because I wanted to also add a front into yacy which tuned out to be harder than I expected. It’s a wonderful project and you can find great stuff through it but the way the peers return results sometimes it’s hard to find it again. It’s also not quite as hackable as I would have hoped at the time probably due to he project age.

I still think there is value in it though and I’d love to see yacy have its protocol explained as an apex so people could,build implementations in other languages more easily.

boyter··on Starbucks $10 pork-flavored coffee
In China it is/was.

Its very expensive for the average Chinese person and is considered fairly fancy or upscale. At least it was when I lived there.

Same rule applies to Pizza Hut.

boyter··on A search engine in 80 lines of Python
Can confirm this book is excellent.

It's one I point people at all the time when they ask me why something isn't working as expected in any standard search tool, and something I reference from time to time to refresh my own knowledge.

Well worth the money.

boyter··on A search engine in 80 lines of Python
On mobile device but it’s the standard weighting values for either TF/IDF or BM25. In this case BM25.

A comment would be useful but they are also instantly recognisable to anyone familiar with the problem.

boyter··on United finds loose bolts on plug doors during 737 Max 9 inspections
Just had all my connections cancelled. So extra day in San Fran for me which is less than ideal, but probably better than being on the flight if something happens.

It was total bedlam at the airport when I got in this morning however. With almost no flights available to replace the grounded ones.

Another red eye special for me tonight but at least no connections.

boyter··on Templ: A language for writing HTML user interfaces in Go
That was my first thought. It looks perfect for use with HTMX.
boyter··on Please, expose your RSS
I don't think this would be practical for a static site. You still need to maintain a list of followers of your account somewhere and that needs to be dynamic if you want it to work the way people expect it to where they follow you from other instances.

Assuming you kept the @ list of accounts through some other means, if you had your webfinger setup with your public key, you could after creating new content to push up sign the publish events and push them to those followers.

I don't know of anyone doing this though.

boyter··on The Fediverse is an opportunity learned societies can't ignore

    Fediverse: We are open for federation and you to join!
    Meta: Ok here is what we are doing with instagram/threads.
    Fediverse: Not that kind of open!
boyter··on Cicadas are so loud, fiber optic cables can ‘hear’ them
We had a big year for them in 2021 in Australia. I was testing an Apple Watch at the time and since exercise was one of the reasons at that time to be allowed out I went for bush walks in my local area.

In quite a few areas the noise was so loud the watch informed me I was going to damage my hearing if I remained in the area.

boyter··on Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)
That’s one of the reasons I made this actually https://github.com/boyter/cs

I wanted and boolean syntax mixed with fzf instant search. It’s not as fast as ripgrep of course but it’s not solving the same problem.

boyter··on Choose Postgres queue technology
I used RabbitMQ for a while and nothing but problems.

Admittedly I probably shouldn't have used it the way I did. I dumped many millions of tasks into it, then fanned out processes pulling from that queue that took a variable amount of time to run. Some ran in seconds, some hours.

I had picked RabbitMQ because I wanted that queue to be durable and resist workers dying, or being restarted. However long lived tasks like this is not really what it was designed for (in my opinion). I kept running into issues where it would take a long time to restart, and stop answering connections and need a restart to continue. I ended up having to write monitoring code to check for this and handle it to have it be slightly reliable.

Im sure it works well for smaller short lived messages, but considering the issues I bumped into I would be hesitant to try it. Id probably reach to redis first with wrappers allowing me to swap out to any other queue as required first.

boyter··on Absurd Success
I wonder if there should be a website like busfactorone.com that lists projects maintained by one person to assist with surfacing this.

It could be it’s resolved though funding them, or getting more people across it. Anything to help mitigate the risk.

boyter··on Ask HN: Tell us about your project that's not done yet but you want feedback on
If you happen to know the name I’d love to hear it. I suspect I’m not searching for the right terms.
← PreviousPage 2 of 34Next →