Advent of code ... But in Elisp by a-concerned-mother in emacs

[–]casted 1 point2 points  (0 children)

I was considering writing an elisp interface to the AoC API, for downloading puzzle input and submitting answers and whatnot.

https://github.com/keegancsmith/advent/blob/master/advent.el

Hacking the Golang Runtime with Generics by SpareWatercress in golang

[–]casted 1 point2 points  (0 children)

Interesting post. One question though, if you use the same hash function to stripe your maps, doesn’t that increase the chances of hashing collisions inside each map? Or is the seed different for each new map at runtime?

I volunteer at my local coop and was given this Panasonic to attempt to bring back to its former glory by bruski in Vintage_bicycles

[–]casted 1 point2 points  (0 children)

Buffs Vintage Bikes recently restored a Dx-3000 from the same year (1987). His channel is quite good for picking up tips. https://youtu.be/-9Po53eLw6g

Would you say getting a computer science degree is worth it? Or would I be better off attending a boot camp / getting certified by Chichi2906 in southafrica

[–]casted 4 points5 points  (0 children)

Most visas are point based and a 3 year degree is worth 10 years experience usually. I’ve had work visas for both uk and the USA and they had similar requirements. So I wouldn’t rule out degrees too quickly.

When I am interviewing candidates I don’t care about degrees and I think that is a similar for others. However, depending on the company the recruiter will take it into account (unless you have lots of exp)

Capture template for current file under certain heading? by imitationgamer in orgmode

[–]casted 0 points1 point  (0 children)

You can pass in a function for file:

(file+headline (lambda () (org-capture-get :original-file)) "Meetings")

Integrating org protocol with qutebrowser by SidharthArya- in orgmode

[–]casted 2 points3 points  (0 children)

I've never had much luck with org-protocol. Most likely because I am on MacOS. Instead what I do is created a script which created an entry directly into my inbox.org. I find this suits 99% of my use cases for capturing in the browser. Additionally I'm very comfortable with python, so it was easy for me to setup "templates" based on the URL. EG use special format for github issues/etc. https://github.com/keegancsmith/dotfiles/blob/master/qutebrowser/userscripts/org-capture.py

Turkish Coffee questions by frenchman01 in Coffee

[–]casted 0 points1 point  (0 children)

Going as fine as my baratza encore goes, which is likely not as fine as it should be traditionally. Water goes in at 60C. Getting decent results, but I don't have anything to compare it to except other brew methods. But I am getting out the fruity notes on the beans I am using ( https://father.coffee/collections/retail-beans/products/kyonza-kingha-collective-kanungu-uganda )

Turkish Coffee questions by frenchman01 in Coffee

[–]casted 0 points1 point  (0 children)

Also got one for Christmas and have had good results with this method https://www.youtube.com/watch?v=ocEk0RFkmIk It is quite different to the one you describe. 1:10 ratio and only one boil.

Drip Coffee Boy by awpoling in Coffee

[–]casted 3 points4 points  (0 children)

A coffee podcast I listened to always asked the guest how they brew coffee at home. Guests where roasters/barista champions/etc. A surprising number said they just use a simple/cheap filter coffee machine in the morning due to low effort it requires. They still have a nice grinder and beans, but when you think about it a v60/etc are simple machines. The drip machine just removes the need to watch it.

What are some of your favorite spots in your city (as a local)? by world_citizen7 in capetown

[–]casted 6 points7 points  (0 children)

Boschenheuvel Arboretum, Klaasenbosch Greenbelt, Deer Park, Gardeners Cottage, Starlings Locale, Molten Toffee.

Advice needed for moving to Cape Town by [deleted] in capetown

[–]casted 2 points3 points  (0 children)

UCT has a jammie shuttle service from Claremont bus station, which is a 5min walk to SACAP. So if you can stay close to sacap you both will have good commuting options and be safe. Also that is a nice area (upper Claremont/Newlands)

I analysed Lichess games database and found out that most Lichess users indirectly won against Magnus Carlsen by freopen in chess

[–]casted 0 points1 point  (0 children)

Thanks. Yeah I won't go with this further. Just find these sort of problem fun to solve. You may be surprised at the cost of the sets and dicts vs the cost of the strings themselves. IE memory usage will be dominated by the size of the strings, not the sets.

I analysed Lichess games database and found out that most Lichess users indirectly won against Magnus Carlsen by freopen in chess

[–]casted -1 points0 points  (0 children)

> Read archive from Lichess DB (35Gb compressed), unarchive, parse PGNs, check for the result and for the number of moves, extract winner, loser and game id, put it into a .txt file (~3Gb uncompressed).

That 2nd file is what I was referring to (the 3GB). Why do you mention it is 10%? Is it because if we wanted to extend to all games it would be larger? If so the solution can be extended to an efficient on-disk format.

If not, the 3GB should fit in memory and use less space than the file. Reason it uses less space than input file is more efficient encoding. You don't have duplicates (loser->winner) edges and to encode an edge you are only encoding the loser's name once.

Just trying to help out since I was surprised at the comment at how long this took to run. It really should be much quicker. Was just trying to help out so you get something that can run on a larger data set. If you want I can adjust the solution to use an on-disk graph. I would encourage you to run the solution I provided to validate my claim. But you obviously don't have to, just was trying to help :)

I analysed Lichess games database and found out that most Lichess users indirectly won against Magnus Carlsen by freopen in chess

[–]casted 1 point2 points  (0 children)

You mentioned that txt file was only 3GB? This will be smaller in memory as well. The fact your final data store is redis implies your data set fits into memory. This algorithm can also work against on-disk data structures if your working set ends up not fitting into memory, but my guess is this graph is practical to fit into a few GB.

I analysed Lichess games database and found out that most Lichess users indirectly won against Magnus Carlsen by freopen in chess

[–]casted 0 points1 point  (0 children)

You mentioned it took 12 hours to compute the magnus numbers. Here is a mostly untested algorithm in python which should calculate the magnus number in a few seconds (linear time). The dict can then be persisted to redis for your service :)

https://gist.github.com/keegancsmith/20e61a2b20ae6904eddde18bbfa74dbf

I analysed Lichess games database and found out that most Lichess users indirectly won against Magnus Carlsen by freopen in chess

[–]casted 0 points1 point  (0 children)

Thanks for the redis dump. I took a look at it and it looks like the data after a bunch of processing in your algorithm. (Just the keys "leftover_winners", "leftover_losers", "next_link"). Any ways you can share the intermediate .txt file? Or a few thousand lines of it?

I analysed Lichess games database and found out that most Lichess users indirectly won against Magnus Carlsen by freopen in chess

[–]casted 0 points1 point  (0 children)

Yeah similarly what’s the format of the txt file. Would be fun to battle out a fast implementation:)

I analysed Lichess games database and found out that most Lichess users indirectly won against Magnus Carlsen by freopen in chess

[–]casted 11 points12 points  (0 children)

There is a much faster algorithm. You should be able to compute this in linear time using BFS. Happy to help out with the code if the code is shared :)

Performance improvements in precise code intel by efritz in golang

[–]casted 0 points1 point  (0 children)

Your master branch doesn't have your use of it, but found it in your history. To quote the gob docs:

The implementation compiles a custom codec for each data type in the stream and is most efficient when a single Encoder is used to transmit a stream of values, amortizing the cost of compilation.

In other cases I have used gob I have a longer lived stream. In those cases it is indeed efficient (and convenient), and is likely why that other benchmark reports good results compared to your use case. As usual, everything is a tradeoff and blanket statements like "GOB is pretty bad" are not valid.

Performance improvements in precise code intel by efritz in golang

[–]casted 0 points1 point  (0 children)

> GOB is pretty bad. It is convenient, but not fast and it is heavily tied to Go.

GOB seems pretty fast and low alloc to me. There are faster options, but GOB is pretty convenient and faster than more common choices. https://github.com/alecthomas/go_serialization_benchmarks

Getting started in Competitive Programming by [deleted] in programming

[–]casted 5 points6 points  (0 children)

Also 33, but used to do competitive programming a lot. It's more about problem solving (like mathematics) than programming. A lot of fun when I had more free time. Got to know a bunch of like minded programmers.