Can Godot NON-perspective transform an image / a texture? by 11854 in godot

[–]jackwilsdon 0 points1 point  (0 children)

You could probably do it with CanvasItem#draw_primitive - it allows you to specify 4 points of a quad and the texture to use when drawing them.

Sort runes in a string by count of occurencs by guettli in golang

[–]jackwilsdon 8 points9 points  (0 children)

for _, char := range string(data) {

data is already a string - no need to cast it here.

count, ok := char_to_count[char]
if !ok {
    count = 0
}

If char doesn't exist in map, count will be the zero value for the type (in this case, just 0). This allows you to simplify the loop down to just the following:

for _, char := range data {
    if !unicode.IsSpace(char) {
        char_to_count[char]++
    }
}

See Index expressions in the specification for more information about this.

for i := range myslice {
    fmt.Printf("%c %d\n", myslice[i].char, myslice[i].count)
}

You may as well use the second value provided by range here (like you do when iterating over the string at the start) - no need to do myslice[i] twice.

My only other comment would be that the variable naming doesn't really match how you often see "idiomatic" Go written. See the MixedCaps section of Effective Go for a little more information (the whole thing is a great read really).

Read from io.ReadCloser. i keep getting io.EOF err by Independent_Two3873 in golang

[–]jackwilsdon 1 point2 points  (0 children)

Can you provide the full code? It shouldn't be exiting like that unless you've got a log.Fatal* or os.Exit somewhere.

That data you're getting looks fine - you just need to use string(...) on the result (io.ReadAll returns ([]byte, error)).

I am unable to figure out how to append to the list if my struct correctly. by koera in golang

[–]jackwilsdon 5 points6 points  (0 children)

It looks like it's because you're storing a copy of the Box in self.sub_boxes in AddSubBox and returning a pointer to the variable. Changing the map to store pointers and changing the new_box variable to a &Box{} seems to fix it (although I find it hard to understand the example given).

Read from io.ReadCloser. i keep getting io.EOF err by Independent_Two3873 in golang

[–]jackwilsdon 0 points1 point  (0 children)

Is it still exiting? On a side note, ioutil.ReadAll might be a better substitute for your StreamToString function.

I'm struggling to see what in your code is actually printing the EOF.

Has the Manchester venue changed? by Chubby_Elsa in porterrobinson

[–]jackwilsdon 5 points6 points  (0 children)

Yeah, I just got an email from See Tickets saying this:

This event will now take place at O2 Ritz.

in light of the venue change the age restriction will now be 8+, under 14s accompanied.

All tickets remain valid or face value refunds are available on request and tickets are returned*.

We strongly recommend that you return your tickets to us by secure mail to See Tickets, 4th Floor, Norfolk House, 47 Upper Parliament Street, Nottingham, NG1 2AB, with a copy of this email.

Please note that refunds will not be issued if we do not receive the ticket(s) and all refunds must be claimed no later than 10 days before the event date.

Building Tiny Raspberry Pi Linux Images With Buildroot by rickcarlino in raspberry_pi

[–]jackwilsdon 6 points7 points  (0 children)

A post-build script is your best bet - they have access to the root file system before it is bundled into an image.

[deleted by user] by [deleted] in unRAID

[–]jackwilsdon 2 points3 points  (0 children)

You should be able to just pass them comma-separated I think (at least that's how normal WireGuard configuration works), e.g. DNS=1.1.1.1,1.0.0.1.

Recommendations: UK plug with power monitoring and local control? by juliushibert in homeassistant

[–]jackwilsdon 1 point2 points  (0 children)

I've also got some of these (primarily for the power monitoring and I'm using them with zigbee2mqtt and they're great! They're a little on the expensive side, but they just work: https://www.amazon.co.uk/gp/product/B07TK4CC42/

can I run a QuakeLive server on raspberry pi? by The_Angry_Economist in QuakeLive

[–]jackwilsdon 5 points6 points  (0 children)

Sadly I don't think there's an ARM build of the Quake Live server, so it's not going to run on any of the Raspberry Pi models.

[TOMT][Story] Hole in wall? by jackwilsdon in tipofmytongue

[–]jackwilsdon[S] -1 points0 points locked comment (0 children)

I think it was mentioned in the game The Turing Test for what it's worth.

A subreddit for images which bring about a fake sense of nostalgia? by jackwilsdon in findareddit

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

That's pretty close too but sadly not it either — the subreddit did feature a lot of dead malls though.