Codingame frequently hosts programming challenges. For this challenge, you have to write a bot controlling a submarine, trying to locate your opponent in spite of incomplete information. You can pick the language of your choice from a rather large selection. This time I’m trying my hand at Rust and so far like it a lot! The challenge will last about a month.
I’ve been working on and off on a client/server version of this, with a persistent daemon process taking care of the database. I feel that would be a better design, as the work performed by the client after each key press would be really minimal. That daemon could also eventually be used for automating other parts of the CLI experience.
I did consider this, but I didn’t want an entire process running on my computer for the sole purpose of serving me cd suggestions. Moreover, given how fast zoxide already is, I doubt that a client-server model would be a massive improvement.
You’re right, I’m sure it’s fast enough. The main point would be to add more features in addition to jumping: a central daemon that talks to all your shells simultaneously could certainly help for many other things.
Yeah, I’ve thought about this as well. Just couldn’t be bothered to figure out all the possible security implications, and never wanted it bad enough. But it could be the sort of generic project that opens up a lot of possibilities we don’t even see yet… Also, who doesn’t love over-engineering stuff ? :-)
Right now I was thinking client/server on the same machine, using a UNIX socket for communication, so the security implications aren’t big. But maybe you’re right, and we could imagine a cloud-based version!
I’ll try to ping you if I ever put something on GitHub :)
Yeah, please do. I shudder to think what the reaction of some folks on HN or here or reddit would be if you announce ‘I made a client-server version of cd’! :-)
Applying to Google can be a great learning experience. But it’s too much work if you’re simply looking for a job. There are zillions of fine companies that don’t make you jump through hoops for three months before giving you a clear answer.
I skimmed the code and the decoder could be improved a lot, it’s not necessarily an issue with the format.
MTF is not ideal for general purpose compression though. The file tested in the readme is html and English text, i.e. a small alphabet with skewed frequencies, which is the best case for MTF. It will probably do significantly worse on binary files.
I imagine it could be used for compression on slower machines (edge or sensors for instance) before transmitting over the network on larger machines. I’m curious about the memory requirements though.
It can be, depending on what you’re talking about. Even though they live under very different regimes, North and South Korea are the same people. Same goes for China.
Not sure in this case though. Management of an epidemic is indeed a responsibility of the state.
Okay, agreed, if we were to discuss e.g. the cultural response to things, then yes. Similarly to West/East Germany, but also Austria, at which point looking at it from the perspective of national states becomes somewhat meaningless.
In this case, less so, so including Taiwan only acknowledges the PRCs claim over the “Taiwan province”.
Thank you for playing around with it!! I think your example falls into the “nonlinear integer arithmetic” space where Z3 cannot always find an answer.
That said, I think perhaps there isn’t a counterexample in your example. (n+333333) will be either positive or negative, and if it’s negative, the product will become positive. If we try something like (n+333333)*(n+333) +1 instead, we can sometimes get the result to be negative! example
Ha! I am going to have to correct myself! Your condition does have a counterexample. make_bigger(-333333) gives a result of exactly 1 which I think is the one and only input that fails your post condition!
Perhaps, all the more reason that I need a computer to help me think about problems like this.😀
Good job :) That was the point of the test, to have only one failing condition with a very big number, so something hard to find if you don’t know how to reason about quadratic equations, which I doubted the solver would be able to do.
I agree with you but I don’t think the math still needs to work out to 40hrs (not sure if you are holding that constant). I would love three 12hrs instead, for instance. Then I can view that time more of a “performance” where you prepare and you go do your three days. 40hrs spread over 5 days is just so wasteful of employees time IMO
Working on a rust bot for this very fun challenge. Currently in the top 30, but competition is fierce!
Codingame frequently hosts programming challenges. For this challenge, you have to write a bot controlling a submarine, trying to locate your opponent in spite of incomplete information. You can pick the language of your choice from a rather large selection. This time I’m trying my hand at Rust and so far like it a lot! The challenge will last about a month.
Are you planning to support lichess accounts? I’d love to try it 😊
The truth is we already support lichess :) You only need to select it from the drop-down :)
Cool! You might want to find a better title for your next posts then :-D
I’ve been working on and off on a client/server version of this, with a persistent daemon process taking care of the database. I feel that would be a better design, as the work performed by the client after each key press would be really minimal. That daemon could also eventually be used for automating other parts of the CLI experience.
I did consider this, but I didn’t want an entire process running on my computer for the sole purpose of serving me
cd
suggestions. Moreover, given how fastzoxide
already is, I doubt that a client-server model would be a massive improvement.You’re right, I’m sure it’s fast enough. The main point would be to add more features in addition to jumping: a central daemon that talks to all your shells simultaneously could certainly help for many other things.
Yeah, I’ve thought about this as well. Just couldn’t be bothered to figure out all the possible security implications, and never wanted it bad enough. But it could be the sort of generic project that opens up a lot of possibilities we don’t even see yet… Also, who doesn’t love over-engineering stuff ? :-)
Right now I was thinking client/server on the same machine, using a UNIX socket for communication, so the security implications aren’t big. But maybe you’re right, and we could imagine a cloud-based version!
I’ll try to ping you if I ever put something on GitHub :)
Yeah, please do. I shudder to think what the reaction of some folks on HN or here or reddit would be if you announce ‘I made a client-server version of
cd
’! :-)Lol, I’m old enough not to care anymore :)
Applying to Google can be a great learning experience. But it’s too much work if you’re simply looking for a job. There are zillions of fine companies that don’t make you jump through hoops for three months before giving you a clear answer.
Decompression performance is unfortunately not that great. I’m sure it has its uses, but probably not for general-public use.
I skimmed the code and the decoder could be improved a lot, it’s not necessarily an issue with the format.
MTF is not ideal for general purpose compression though. The file tested in the readme is html and English text, i.e. a small alphabet with skewed frequencies, which is the best case for MTF. It will probably do significantly worse on binary files.
I imagine it could be used for compression on slower machines (edge or sensors for instance) before transmitting over the network on larger machines. I’m curious about the memory requirements though.
“Responsibly mapping” and then including Taiwan into it, over which the PRC has about as much control as over any other neighboring country?
You could argue it’s still part of China, which is composed of two states.
Which would be roughly as sensible as grouping North and South Korea together.
It can be, depending on what you’re talking about. Even though they live under very different regimes, North and South Korea are the same people. Same goes for China.
Not sure in this case though. Management of an epidemic is indeed a responsibility of the state.
Okay, agreed, if we were to discuss e.g. the cultural response to things, then yes. Similarly to West/East Germany, but also Austria, at which point looking at it from the perspective of national states becomes somewhat meaningless.
In this case, less so, so including Taiwan only acknowledges the PRCs claim over the “Taiwan province”.
Neat!!!
It’s not foolproof, of course. I was able to defeat it with large numbers:
I guess that’s expected though. An SMT solver can only do so much. And that’s probably not a huge issue in practice.
Thank you for playing around with it!! I think your example falls into the “nonlinear integer arithmetic” space where Z3 cannot always find an answer.
That said, I think perhaps there isn’t a counterexample in your example.
(n+333333)
will be either positive or negative, and if it’s negative, the product will become positive. If we try something like(n+333333)*(n+333) +1
instead, we can sometimes get the result to be negative! exampleHa! I am going to have to correct myself! Your condition does have a counterexample.
make_bigger(-333333)
gives a result of exactly 1 which I think is the one and only input that fails your post condition!Perhaps, all the more reason that I need a computer to help me think about problems like this.😀
Good job :) That was the point of the test, to have only one failing condition with a very big number, so something hard to find if you don’t know how to reason about quadratic equations, which I doubted the solver would be able to do.
Can you use this with cmd.exe and bash as well? Or is it powershell only?
Works with all three.
Yes all three in a really nice package. In fact you can default to the Linux shell on loading Terminal.
I’d much rather work fewer but longer days. I feel it would be more efficient since I need a few hours to get back in business every day.
I agree with you but I don’t think the math still needs to work out to 40hrs (not sure if you are holding that constant). I would love three 12hrs instead, for instance. Then I can view that time more of a “performance” where you prepare and you go do your three days. 40hrs spread over 5 days is just so wasteful of employees time IMO