Live data from Hacker News

I figured out how to get GitHub Copilot to run in the terminal

github.com

61–70 of 105 posts

Re: I figured out how to get GitHub Copilot to run in the terminal

#61

Earlier quoted context omitted.

It is absolutely amazing for writing boilerplate code that is also context aware. It saves me hours of typing. It's hard to explain if you've never tried it because you're ideologically opposed to it, but stop being close minded and try it out, I promise it's a great tool to assist your programming.

Good codebases don't need boilerplate to do basic stuff: in this sense, copilot is a patch over the real problem, which can be solved with better frameworks and more code reuse. I tried copilot during the beta, and apart from the obvious legal licensing issues, I simply could not find a valid usecase for any of the codebases I usually work with. At my day job, I spend more time thinking of better ways to do X, rather…

I have found Copilot useful while writing compilers and virtual machines all the way up the chain to CSS grids and media queries.

Are you telling me there isn’t a fair bit of boilerplate in bog standard implementations of OP_ADD or in a grid layout with a sidebar and a footer?

The irony here is that the level of abstraction necessary to remove all boilerplate means that you’re removing the descriptive nature of the boilerplate and making your code difficult to understand.

Boilerplate isn’t necessarily a bad thing but sometimes it can be rather verbose and it is very nice to offload that typing to a tool.

Re: I figured out how to get GitHub Copilot to run in the terminal

#62
post #37
post #17

By the way, the example snippet given to "echo a random number between 1 and 10" is incorrect, pedantically speaking. It's random, but not uniformly so. It's biased towards lower numbers (1-6).

Could someone explain how? I don't grok the command. My best guess is this relates to hexadecimal.

To add to this: (one of) the correct solution(s) is

  R * 10 / 256 + 1
EDIT: I am wrong, this still has bias.

Re: I figured out how to get GitHub Copilot to run in the terminal

#63
post #41
post #38

Earlier quoted context omitted.

`cat /dev/urandom | od -N 1 -An -i` gives you a uniform random number between 0 and 255. The following mod 10 in the awk command introduces "modulo bias", which you can read about here https://research.kudelskisecurity.com/2020/07/28/the-definit... You can see it quite intuitively if you iterate over all possible numbers between 0 and 255: $ (for i in {0..255}; do; echo $i | awk '{print $1 % 10 + 1}'; done) | sort -n…

But that is not how /dev/(u)random works and does not give U(255). Generally speaking, it gives some hash of some user/device activity, from these resources: https://linuxhint.com/dev_random_vs_dev_urandom/ https://en.wikipedia.org/wiki//dev/random

> does not give U(255)

What do you think each byte from /dev/(u)random is?

Re: I figured out how to get GitHub Copilot to run in the terminal

#64

Earlier quoted context omitted.

Good codebases don't need boilerplate to do basic stuff: in this sense, copilot is a patch over the real problem, which can be solved with better frameworks and more code reuse. I tried copilot during the beta, and apart from the obvious legal licensing issues, I simply could not find a valid usecase for any of the codebases I usually work with. At my day job, I spend more time thinking of better ways to do X, rather…

I have found Copilot useful while writing compilers and virtual machines all the way up the chain to CSS grids and media queries. Are you telling me there isn’t a fair bit of boilerplate in bog standard implementations of OP_ADD or in a grid layout with a sidebar and a footer? The irony here is that the level of abstraction necessary to remove all boilerplate means that you’re removing the descriptive nature of the b…

Whenever I have boilerplate in a codebase I try to make a tool to create it for me. So copilot does seem like an extension of that.

I think the thing that weirds me out about copilot is that I can't peer inside it. I guess I like knowing something will always work?

Re: I figured out how to get GitHub Copilot to run in the terminal

#65

Earlier quoted context omitted.

It is absolutely amazing for writing boilerplate code that is also context aware. It saves me hours of typing. It's hard to explain if you've never tried it because you're ideologically opposed to it, but stop being close minded and try it out, I promise it's a great tool to assist your programming.

Quoted post unavailable.

I was against copilot until I tried it.

It’s not always on target, but it’s usually pretty close and the suggestions are good.

No, it doesn’t write all of the code for me. But it does rapidly construct even quite complicated if/else statements that I was going to write anyways, just from knowing where I’m typing. Quite a great tool.

Re: I figured out how to get GitHub Copilot to run in the terminal

#66
post #44

It’s generally claimed that reading other people’s code is harder than writing your own. I mean, everybody loves writing code on a greenfield project but hates maintenance of legacy code, right? So, why do people like these code generators? The only explanation I can see is that people use them and then don’t read the code . Which would be horrifying. (I stay away for obvious copyright reasons.)

nothing tells me you've never even tried it as much as this comment of yours

it is "intelligent context-aware code autocomplete on steroids"

Re: I figured out how to get GitHub Copilot to run in the terminal

#68
post #63
post #41

Earlier quoted context omitted.

But that is not how /dev/(u)random works and does not give U(255). Generally speaking, it gives some hash of some user/device activity, from these resources: https://linuxhint.com/dev_random_vs_dev_urandom/ https://en.wikipedia.org/wiki//dev/random

> does not give U(255) What do you think each byte from /dev/(u)random is?

[deleted]

Re: I figured out how to get GitHub Copilot to run in the terminal

#69

Earlier quoted context omitted.

It is absolutely amazing for writing boilerplate code that is also context aware. It saves me hours of typing. It's hard to explain if you've never tried it because you're ideologically opposed to it, but stop being close minded and try it out, I promise it's a great tool to assist your programming.

Quoted post unavailable.

Calling fellow commenters stupid or ignorant isn’t right. Please reconsider.

Re: I figured out how to get GitHub Copilot to run in the terminal

#70
post #42
post #41

Earlier quoted context omitted.

But that is not how /dev/(u)random works and does not give U(255). Generally speaking, it gives some hash of some user/device activity, from these resources: https://linuxhint.com/dev_random_vs_dev_urandom/ https://en.wikipedia.org/wiki//dev/random

I know how urandom works (consider reading the articles you linked). The number between 0 and 255 is produced by the `od` command: https://man7.org/linux/man-pages/man1/od.1.html

[deleted]
Post reply on HN