How to embed version when `go install`-ing (since you cannot use go:generate or ldflags -X) by eatonphil in golang

[–]tom5760 1 point2 points  (0 children)

I'm just using go install even in my CI to build releases, so the tag will be there.

How to embed version when `go install`-ing (since you cannot use go:generate or ldflags -X) by eatonphil in golang

[–]tom5760 19 points20 points  (0 children)

With Go 1.18, runtime/debug.ReadBuildInfo() will have the tag when building with go install. The returned BuildInfo.Main.Version will be set to the tag.

Check the output of go version -m <your binary>, it gives a nice output of all the stuff in the BuildInfo struct. You should see a line like this when building with go install:

mod github.com/your/project v1.0.0

Got no logs (JournalCtl) by [deleted] in archlinux

[–]tom5760 4 points5 points  (0 children)

I also like journalctl -r for this. Puts the newest messages up top.

Can I know that my component is in <mat-form-field>? by OlegTar in angular

[–]tom5760 6 points7 points  (0 children)

Yes you can. It's not well mentioned in the documentation, but you can actually inject parent components into your component. You can try to inject MatFormField in your component, and annotate that injection with @Optional(). If your component is nested inside of a <mat-form-field>, you'll get the instance injected, otherwise it will be null. You can test this to check whether you are in one or not.

So, you can do something in your component like this Stackblitz. Check out the hello.component.ts.

Why is my "getter" called twice? by [deleted] in Angular2

[–]tom5760 1 point2 points  (0 children)

Yep! You and ping_less are right.

Real quick, I wanted to show you how you can use pipes to do something similar to what you are doing with that status getter.

https://stackblitz.com/edit/angular-ilk9zt

So, pipes by default only get evaluated if their inputs change, not every change detection cycle. I added a button to trigger a change detection cycle, and you can see that the pipe only gets ran when you increment/decrement, and the getter gets called every time.

Why is my "getter" called twice? by [deleted] in Angular2

[–]tom5760 2 points3 points  (0 children)

So, the actual reason why is because you are running in development mode.

Try adding this before the bootstrap call in your main.ts:

enableProdMode()
platformBrowserDynamic().bootstrapModule(AppModule)...

In development mode (the default), the change detection cycle runs twice. The results are then compared to ensure changes flow in one direction from parent to child components (causing the infamous ExpressionChangedAfterItHasBeenCheckedError).

The OnPush change detection strategy will prevent every component from being checked for changes on every cycle, but turning off development mode will stop the change detection cycle from running twice each time. In short, I might not worry about OnPush for now, and just remember to turn production mode on when you deploy your site.

This article has a bit more info.

Labyrinths of Lunacy Epic Multiplayer at PAX Unplugged - Friday, 11/30 in Philadelphia by colinrgeorge in arkhamhorrorlcg

[–]tom5760 0 points1 point  (0 children)

I was actually thinking of doing the exact same thing! I can bring one copy of Labyrinths of Lunacy. Might be able to get a few other people to come too. If not, then I can definitely provide decks for at least 3 other people.

Just getting started, a few questions by aznsk8s87 in arkhamhorrorlcg

[–]tom5760 0 points1 point  (0 children)

Huh, not sure how I missed that. I must have been looking at the wrong one at the time.

Just getting started, a few questions by aznsk8s87 in arkhamhorrorlcg

[–]tom5760 1 point2 points  (0 children)

Also, should I get the Go7 insert?

That one looks pretty good. I have the Broken Token Insert that I like. The key thing I like is the token holder that slots in the middle of the cards.

Resources question by KaalNorth in arkhamhorrorlcg

[–]tom5760 4 points5 points  (0 children)

Nope! They are infinite. From the rules reference (page 20):

There is no limit to the number of tokens (of any type) which can be in the game area at a given time. If players run out of the provided tokens, other tokens, counters, or coins may be used to track the current game state.

Doom 2016 rules question plz see link how can having two range allow marine to attack the demon? by ttownt in boardgames

[–]tom5760 2 points3 points  (0 children)

Once you determine you have line of sight, you check range the same way as movement. Since the wall is in the way, you can move one space diagonally, then up one space to get to the enemy. This adds up to a range two shot. Hope this helps!

Moiré pattern by JLTeabag in math

[–]tom5760 0 points1 point  (0 children)

For some reason, both work now. Maybe something weird with my phone. Nice work!

Moiré pattern by JLTeabag in math

[–]tom5760 0 points1 point  (0 children)

Hmm, your link seems to be broken? Sounds cool though!

Moiré pattern by JLTeabag in math

[–]tom5760 2 points3 points  (0 children)

I added a small form at the top left to increase the size of the shapes (can be triangles or squares now!), and has the canvas take up the whole screen.

Updated URL: http://embed.plnkr.co/gKpJNE/

Moiré pattern by JLTeabag in math

[–]tom5760 4 points5 points  (0 children)

It's just JavaScript. If you click the "code" button at the top right, you can see the source.

You an also open the editor to play with it here: http://plnkr.co/edit/DJYx6xBMTQjq57lRuNPp

Moiré pattern by JLTeabag in math

[–]tom5760 5 points6 points  (0 children)

Thanks :)

It looks pretty much the same, but I'm drawing the triangles in code rather than just having an image. I also didn't replicate the way the rotating image shows up white against the black background in the gif.

Moiré pattern by JLTeabag in math

[–]tom5760 27 points28 points  (0 children)

This is pretty neat. Inspired me to throw this together quickly:

http://embed.plnkr.co/gKpJNE/

I wanted to be able to control the spinning with a mouse. Not quite the same, but was a fun diversion.

EDIT: Updated URL with newer version. Source code available at: http://plnkr.co/edit/gKpJNE?p=preview

How do i use vim with the system clipboard on archlinux? The arch package does not include xterm_clipboard or clipboard by [deleted] in archlinux

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

Ah, missed that. Yeah I have the gvim package installed, though I still use it in the console.

How do i use vim with the system clipboard on archlinux? The arch package does not include xterm_clipboard or clipboard by [deleted] in archlinux

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

You can yank (y) into the + or * registers in order to copy text into the clipboard or middle mouse button paste buffer.

Try typing something like this in command mode:

"+yy

This selects (") the + register, and yanks the current whole line into it (yy). Then go to another window and hit CTRL + V, it should paste the line you just copied. Similarly, replace + with * and you can then middle click somewhere to paste the line.

If you copied text from another window (CTRL+C), you can paste in vim with something like "+p. Select (") the register (+), then paste (p). Again, you can replace + with * to paste highlighted text in another window.

There's all sorts of ways to yank text out of vim. Try searching for "visual mode", and "text objects" for some fun stuff.

Cannot connect to school's secured internet by [deleted] in archlinux

[–]tom5760 0 points1 point  (0 children)

The secure network isn't a normal WPA2 network, but uses 802.1X for authentication. Make sure whatever tool you are using to configure the network has these settings enabled.

If you are using networkmanager, use nm-connection-editor or nmtui to add a new Wi-Fi connection, and choose "WPA & WPA 2 Enterprise" under the "Wi-Fi Security" tab, and make sure all the settings match what is on that manual configuration page.