Hacker Newsnew | past | comments | ask | show | jobs | submit | sarp's commentslogin

Congratulations on the launch Tim, love the CMD + 0 shortcut and local model support. It's definitely something I'd use!

Bug report: cmd + 8 is behaving weird on my laptop, maximizing and minimizing several times (Mac OS Sonoma 14.5). Happy to provide more details!

Also, I'd expect pressing cmd + 0 to act like a toggle, to close it if it's already open (instead of needing to press escape), but maybe that's just me!

Looking forward to future work on this!


Sarp! Good to hear from you! I hope life has been good since the Instagram days. Yes, I've noticed the multi-resizing issue with cmd + 8 - I'll look into it this week. Regarding the cmd + 0 toggle, I think I can probably make that work too. We can set it up so you can set your dismiss shortcut. Then, you can choose the same as the launch shortcut, making it a toggle. I'll also take a look at that this week.


Oh no, ⌘+0 is so useful for resetting zoom level. Glad it’s (apparently) possible to change it!


It's hard to find unoccupied shortcuts these days! I don't use shortcuts on the numbers often, so I set that as a default. But yes, it's easily configurable in settings so you can choose something that works for your workflows.


Looks like react query builder: https://react-querybuilder.js.org/


Yes


Hi Jon, challenge author here! First time watching your content, it was fun to see a Rust expert go through the challenge live. Saw the first hour, I noticed that during Bencode parsing, trying to find the most elegant way to implement it slowed you down a bit. (I also have this tendency and I'm sure having so many viewers doesn't help :)) Great progress by the way in 4 hours, hope you get to finish the challenge soon!


Hi! Sarp here, author of the Build your own BitTorrent challenge on Codecrafters.

Some back story: After being laid off from my FAANG job, I found myself very unmotivated to go back. I started looking for interesting programming projects to revive my interest in coding. While nomading, I discovered Codecrafters on Nomadlist and really liked the push code to git and pass different stages interaction. The gamification helped me focus and projects allowed me to go deeper on software I used (SQLite, Git, Redis etc.). I even picked up a new language (Go) to do the challenges with. After completing all the challenges on the site, I ran out of things to do. This is when I decided to build a BitTorrent client which was one of the highly voted ideas on the site.

I learned many new things by building a BitTorrent client: the BitTorrent protocol, how torrent files are structured, encoding issues, pipelining network requests, url encoding binary values, using Channels in Go etc.

I’d love any feedback on the challenge. Also happy to answer any questions!


Its not uncommon for invite-only trackers to be very prescriptive about which torrent clients can and can't be used with their private tracker. Any ideas on how to overcome this obstacle to wider adoption?


Is this something you expect to use as your main torrent client?


How do they tell one client from another?


User agents, fingerprinting, etc. There are certainly ways to mask your client, but these would be considered cheating by most private trackers and would be grounds for a ban.


There's a whole ton of bluster in the torrent community. Bittorrent is a simple protocol, to the point of being naive (and therefore a fun toy network app project). Clients identify themselves to the tracker by user agent; there's really nothing else to fingerprint against. Claims to the contrary are almost certainly bullshit to scare people out of editing their user agent.

Clients also self-report the amount of data transferred. That's not great in a community that fetishizes share ratios. I've heard an op say "there's no excuse for having a ratio less than 1", which makes as much mathematical sense as the parent who told my (math) teacher friend "this is [private school], no student should be below average".

You can theoretically verify upload/download numbers because the total amount uploaded in a swarm should equal the total amount downloaded, but there are all kinds of reasons why the numbers wouldn't match. Maybe a client lost connection and couldn't send its final announce. Maybe one client is sending bad data (I'm not sure how that is reported, might be implementation specific). And clients only send transfer total updates when they connect to the tracker to change status or request more peers, so every client will have a different degree of staleness.

Even if you can tell that someone in a swarm is lying, who is your culprit? As long as they're not being egregious, there's no way to tell.


There's at least some differences, such as HTTP/2 usage, or maybe algorithm usage/bugs in newer versions. Whether or not most tracker staff actually bother to attempt fingerprinting, IDK.


> "there's no excuse for having a ratio less than 1"

Maybe the context of the quote was in regard to a private tracker?

The "ratio" in terms of private trackers isn't always the real ratio of GBs uploaded or downloaded.

There are for example some private trackers that grant additional credit for longer seed-time or they declare specific torrents "freeleech" so they don't "cost" ratio.

In the end they are just some of the measures private trackers take to strengthen their network, but they lead to a confusing definition of "ratio".


Yes, but this tracker did not offer any such things. The only reason the mean ratio of active members was > 1 was because of the steady stream of users being banned for low ratios.


How did you learn to build a BitTorrent client? I love the idea of codecrafters and books that walk you through building something but I always struggle if I don't have something to get me started.


My starting point was searching for tutorials and asking ChatGPT to implement a torrent parser :) There are great blog posts [0] for building a BitTorrent client. Along the way, I referenced open-source implementations and the BitTorrent Protocol Specification as well [1].

[0] https://blog.jse.li/posts/torrent/

[1] https://www.bittorrent.org/beps/bep_0003.html


I've actually just begun work on a project involving bittorrent, I don't think I will be implementing a client but maybe, I'm certainly going to have to implement generation of .torrent files and magnet links, so I've been learning a little bit about the protocol. Interesting to see this pop up and maybe I can use it to help me make headway.


> After completing all the challenges on the site, I ran out of things to do. This is when I decided to build a BitTorrent client which was one of the highly voted ideas on the site.

Are you employed by them now?


I'm not an employee of Codecrafters. I worked with them for the BitTorrent challenge as an independent contractor.


This is such a cool result. I would love to see the next step of creating a tool like Resilio sync that builds upon this work!


I don't know if this is feedback on the challenge per-se, but I was a little saddened that I couldn't add dependencies to my `Cargo.toml`; I wanted to solve part of the bencode challenge using nom (perhaps overkill, but it was for fun), but I can't.

If this is a concern of load/execution times on a remote builder, it would be cool if I had some way to run the testcases locally to avoid this concern


We just shipped support for this last week! You should be able to edit the file now. We’ll remove the comments saying those files can’t be edited soon.


Oh! Awesome! I'll have to give this a shot, then :)


Are we gonna get extensions to the challenge?


Better yet, extensions to implement BitTorrent extensions? Such as the mutable torrent BEP and others? It'd be great if this spawned hundreds of top quality BitTorrent clients


Build your own Extension


To limit the scope of the challenge, I had to leave out a lot of cool features you see in modern clients: magnet links, UDP trackers, DHT

I'm planning to add them over time starting with magnet links which is the highest voted extension idea right now


Hi, course author here! You're right, this was left out initially to scope down the challenge (it's already quite long with 11 stages). We're planning to add it as a challenge extension, uploading is one of the highly voted challenge extension ideas by the community.


If it were structured in fashion closer along the protocol startup process or how a real client is structured more people might end up with a functional client rather than a "bittorrent leecher". Up to "peer handshake" most things look fine. From there it rushes towards a half-finished goal and if people stop there you're leaving the internet littered with one-sided examples.

After the handshake you'll need state machines to handle multiple peers, piece-sets to track what you've downloaded, the rarest-first algorithm[0], message processing and so on. The final result of having a downloaded file falls out of that almost as a side-product at some point.

[0] http://bittorrent.org/bittorrentecon.pdf


Could it be because dark chocolate has caffeine in it?


any tips on how to find part time work?


In my case, I just took a full time non-tech salaried job and used my tech skills to automate my duties or do them more quickly. So I work 20 hours but get paid for 40. My company is results oriented and they don't care; they're generally pleased as pie I have a little extra capacity for when emergencies crop up.


I'd be interested to know what non-tech work you do. I'm unemployed right now for similar reasons as OP (looking for happiness). Does your current job satisfy the "programmers itch"?


I work in political communications, but that was an accident. I trained/was planning to do tech work for libraries and academic institutions. (So things like working for JSTOR, ProQuest, LexisNexis, etc.) They're not tech companies, but they do need tech expertise, particularly on the back end.

The nice things about academia are that if you're not on the tenure track, you don't have to spin your wheels trying to publish or perish, you get to meet and talk to a lot of intelligent people outside of your field, and they often have a decent work-life balance. The downsides are that you're not going to be working with the newest tech, people sometimes poo poo what you do/there are a lot of status games, and it's SLOW.

It does not satisfy my programming itch, but I prefer for my tech projects to be on my own time and for play.


The idea has crossed my mind before, so I'm quite interested to find someone doing it. What line of work are you in?


I work in political communications, but I trained/planned to work for libraries and academic institutions/companies as a tech person/tech adjacent person. So places like ProQuest, LexisNexus, or being an academic librarian who did research relating to HCI.


Ask your boss if you can work less?

I vaguely remember hearing that it's actually illegal for your boss to deny this without some good reason, but I suppose it might not be that hard to come up with some excuse either.

Sometimes jobs have a minimum number of hours per week posted, but most of the time it's simply part of the benefits negotiation. Paid days off per year, public transport pass, salary amount, how many hours per week, IP of any open source projects I work on, it's just part of what I talk about when negotiating my contract. And it doesn't have to be at the beginning of your employment.


Look for European companies, they tend to be more flexible about that.


I don't see Turkey on the list :(


Will get that added for you within the next few days :)


Also Israel is missing


Thank you so much for this! I wanted to try it out for a long time, but was waiting for a discount. It was a no brainer at $49 :)


I find it easier to get into the zone after morning exercise.


Doesn't have to be after exercise, but if I haven't gotten sweaty in a day or two, productivity lags.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: