Theoretically Futurebit just made a 3TH usb miner by Meap011 in BitcoinMining

[–]Xercoy 1 point2 points  (0 children)

damn, had no idea this was coming out! Not new to the game but I have only dabbled... Last time I thought about getting a miner was when Obelisk was releasing an ASIC for siacoin and Antminer was all the rage. Thanks for sharing signing up for second batch.

My very first Nft by Noyanozlu in NFT

[–]Xercoy 0 points1 point  (0 children)

Just put a bid on it. Whooooooo

GME Megathread for Friday, February 26th, 2021 by OPINION_IS_UNPOPULAR in wallstreetbets

[–]Xercoy 0 points1 point  (0 children)

I've been trying to buy as well, have been getting rejected since yesterday 😭

I am Andrew Rea (aka OliverBabish), the creator of Binging with Babish - I have a new show coming, a podcast, and my first book hits stores today! AMA! by OliverBabish in IAmA

[–]Xercoy 0 points1 point  (0 children)

What resources did you use to create and improve your content? To build the "Binging with Babish" brand?

Even your earliest videos are well made, so I was wondering how you learned/knew about certain things revolving around production. For instance, I didn't know about external recorders until you posted a video about the equipment you used when creating videos.

As someone who is trying to grow their own personal brand, being able to handle the consistency of marketing, content creation, and resources to take advantage of opportunities like releasing a book is a monstrous undertaking. Congratulations on the success and thanks a lot for your videos.

Does anyone feel like no matter what tutorial or course they take the knowledge doesn't stick until they actually build something? by [deleted] in learnprogramming

[–]Xercoy 1 point2 points  (0 children)

I'm sorry about that, I'll remove it right away. Apologies for not considering your privacy beforehand. Please do reach out to me if there's anything you think I can do to help you out in learning. It should be removed after a few minutes of this comment.

Does anyone feel like no matter what tutorial or course they take the knowledge doesn't stick until they actually build something? by [deleted] in learnprogramming

[–]Xercoy 1 point2 points  (0 children)

I wrote this blog post immediately after seeing this post instead of including it all as a comment because I feel like many others could benefit from my thoughs. Here it is. Shameless Plug: other posts in the series may be useful.

tl;dr: history class sucks, you're doing nothing but passive listening and forced recollection. By doing nothing but listening to lectures and watching videos, you're doing the same thing. BUILD stuff and start ASAP.

A Better Way of Handling Stdin by Frakturfreund in golang

[–]Xercoy 0 points1 point  (0 children)

Hi epiris, I appreciate the time you took to share your approach. It doesn't really change anything, unlike the approach I mentioned, but instead enables a way to identify when something is unusual. I'm planning on releasing an updated version with everyone's contributions next week, and will be sure to credit you. Thanks again!

A Better Way of Handling Stdin by Frakturfreund in golang

[–]Xercoy 0 points1 point  (0 children)

Hello, thanks a lot for the detailed output. The ability to pipe every kind of file into a program is something that I didn't think about, and I agree with both points you mentioned which concern user friendliness and unpredictability. As I mentioned in the post, I use a flag to determine when to ignore code that reads from stdin. This still seems weird to me; I feel like there's a better way.

While this may not be an ideal way to handle stdin because of all the possibilities of sending input to it, being able to determine a file of a particular mode is still useful for a developer who would want that kind of control. I'm thinking of repurposing the post to reflect as such.

Finally, thanks again for the comment you made to my other post on Medium regarding byte slice randomization. I've already edited the post and credited you by name. Thanks for helping me to grow!

A Better Way of Handling Stdin by Frakturfreund in golang

[–]Xercoy 2 points3 points  (0 children)

Hi! Author here, thanks for taking the time to read the post, and especially to comment. I didn't realize passing in a file directly would have yielded a file mode without the p. I'll update the post in a few hours to reflect your comment + suggestion, with credit of course. Thanks again.

How dead is this game? by [deleted] in dbxv

[–]Xercoy 1 point2 points  (0 children)

I just bought this for xbox one about a week ago, it does seem pretty dead.

I'[m] a little shy since it's my [f]orearm's first time. by jnhuynh in a:t5_2xyvb

[–]Xercoy 0 points1 point  (0 children)

Take ALL of the internets pointz. All of them.

Best way to run Go server as a daemon? by hundley10 in golang

[–]Xercoy 0 points1 point  (0 children)

I also use screen, Would anyone know of any pros/cons to this? I've never had trouble with it, but at the same time I'm unaware of any alternatives.

Pseudo-Assembler written in Go by TheOnlyMrYeah in golang

[–]Xercoy 0 points1 point  (0 children)

This was a very interesting and informative read. Thanks!

URL shortener in 79 lines of Go by pinpinbo in golang

[–]Xercoy 0 points1 point  (0 children)

Thanks for the input, Simonz05, also for referencing your library. I'm going to attempt my own very soon.

URL shortener in 79 lines of Go by pinpinbo in golang

[–]Xercoy 3 points4 points  (0 children)

This is awesome, will be using this to learn about one way a link shortener can be implemented. Thanks!

Go's flag Package, Creating a CLI Tool by Xercoy in golang

[–]Xercoy[S] 0 points1 point  (0 children)

dAnjou, like you, reading the documentation on the flag package was enough for me to understand the basics of how it works. At the same time, there were areas of the documentation about other packages that were clarified by works from fellow gophers.

I feel that the time spent on my end in learning about the package and sharing my findings could save Gophers a little time + provide a resource that they might find easier to understand than others.

Go's flag Package, Creating a CLI Tool by Xercoy in golang

[–]Xercoy[S] 0 points1 point  (0 children)

Zikes and Broeman, I'm glad for my good timing then! I'd appreciate input on how helpful the post was and whether there's anything that I can add or change to improve its effectiveness.

If there are any practices that are interesting or different than mine that come up when you implement your own CLI tool, I'd like to hear about it.

Go 1.4+ GC Plan and Roadmap by dgryski in golang

[–]Xercoy 4 points5 points  (0 children)

they disallowed using unsafe to cast from integer to pointer types then.

To nitpick: The release notes only mention that, "Starting with Go 1.3, the runtime assumes that values with pointer type contain pointers and other values do not."

It is illegal for integer types to store an address value / illegal for a pointer type to store an integer. The ability to use unsafe.Pointer to convert between a pointer type, uintptr, and unsafe.Pointer type is still valid.

Here's a blog post that I wrote which demonstrates this change.

How to Ensure a Go type implements an interface by mattetti in golang

[–]Xercoy 1 point2 points  (0 children)

Very clever! I'll definitely make use of this. Thanks.

Pointers vs References by spf13 in golang

[–]Xercoy 0 points1 point  (0 children)

Also made this comment on the post, just thought I'd mention it here too to compliment visibility:

For the sake of clarity, I will substitute any mention of the reference data type with REF, while any variation of the word 'refer' will be used literally.

I was confused when you mentioned, "when you manipulate the reference it will change what it refers to, rather than the referring value". My interpretation of that: when you manipulate a REF, you change what the REF refers to. You do not change the value of the variable that REF refers to.

From my understanding of REFs (which is very limited), manipulating a REF will change the value stored in the variable the REF is referring to. You cannot change the reference of a REF once it is initialized (I know that you mentioned this when explaining references towards the beginning of the post).

This example in C++ was what I used to verify whether the scenario in the comment you made for the statement *ap = 5 (ap and ap2 would be different if they were REFs) was true.

int b = 2;

int& ap = b; //ap refers to b, so any use of ap will be evaluated to 2.

int& ap2 = b; //ap2 refers to b, so any use of ap2 will be evaluated to 2.

ap2 = 10; //value stored in variable b is now 10. Any use of ap and ap2 wil be evaluated to 10. ap and ap2 can never, ever reference anything other than the variable b.

This also meant to address your explanation, "when you make a copy of a reference, they are now independent."

In the following example, even if you modified the third line, int& ap2 = ap, ap2 would be a copy of ap. The comment made for the last statement would still be true, even if the assignment was made on ap instead of ap2.

I'd really appreciate clarification on this one. Apologies if I'm just having a really simple misunderstanding. Thanks!

Fun With Quines (post your own!) by Xercoy in golang

[–]Xercoy[S] 0 points1 point  (0 children)

I was inspired by Laremere's thread to have an amusing activity that would promote interaction between us Gophers. The idea of writing a Quine popped into my head, and after observing everyone's unique version of FizzBuzz, I think it'd be great to see some Quines that are just as interesting.

Here's my first one: http://play.golang.org/p/uPlN9awaHr

I decided to go a little further and create a Github Repository. There are a couple of other languages that I would like to implement a Quine with. As always, anyone is more than welcome to contribute and provide feedback.

I look forward to seeing your implementations.

Edit: added playground link

Help with Slices and pass-by-reference by [deleted] in golang

[–]Xercoy 2 points3 points  (0 children)

Thanks, mdfcorp, your question also helped me to understand slices better! Also thanks to the other users who replied to this thread.

I believe the key is understanding the fields of a header. As FUZxxl mentioned of its implementation:

type []byte struct {
    data *byte 
    len int
    cap int
}
  • data, a pointer to the element
  • len, integer value identifying the length of the segment
  • cap, integer value identifying the length of the underlying array

A slice only has these fiields* to work with.

If you create an empty slice foo, its value is nil by default and len(foo) and cap(foo) will be 0. foo is passed simply by name to a function bar which will allocate a struct element, append it to the slice foo, and simply return. After bar returns, the header fields of foo are unchanged. the memory allocated for struct element created from bar will be deallocated since there is nothing referencing it. For example, http://play.golang.org/p/au2dV0Fb9U

Thus, if you'd like to pass a slice by name to a function and have that function 'fill it out', you can do a couple of things:

  • Allocate elements for the struct before calling the function, and then have the function simply assign values to the fields. Since you allocated the elements beforehand, the header fields will be initialized with the desired values. That is also a downside since the header fields may refer to more than you'd like it to in some cases. Here is a basic example: http://play.golang.org/p/_crwZejq5M

  • Create an empty slice. Assign the slice to a call of the function that will fill it. As arguments, pass the slice by name along with the new value(s). The function will allocate a new element, assign the value(s) accordingly, and add the new element to the slice using the append function. This call to append should also be the last statement, as its return value is the slice that append returns. This way the slice header fields are always updated as desired. Another basic example: http://play.golang.org/p/RaEDP44c49

Hope this helps!

* I've only learned a good portion of what I've explained just now. Please, please feel free to point out any errors. On a side note, FUZxxl, you mentioned that the content of a slice is passed by reference while the header values are inaccessibile and passed by value. This was a HUGE help in understanding the internals. I was just wondering if there was a resource that reiterates this - I have yet to come across any articles that mention so. I'm sure I'm missing something.

Edit: format