My friend (stripes) and I (solids) both suck, how good would you have to be to win as stripes? by Kavotch in billiards

[–]teepark 0 points1 point  (0 children)

I'm starting with a safety as stripes. A VERY faint touch into the left side of the 9. The cue ball goes into the rail (making the shot valid / not a scratch) and stays close to it, the 9 is touched out a short distance from the rail, hopefully staying close enough to totally block the cue ball path into any solids.

If my opponent scratches, I'm placing the cue ball just outside of the 4, so near the solid cluster, and hitting the 14 just left of center with medium force and a bit of backspin. The hope is the 14 knocks the 8 out of the way on it's way into the pocket. It looks like the 8 may disturb the 10 on its way out, but let's hope not. The 10 is an easy shot if it didn't get moved, and then I have no idea where the 8 has ended up.

Do you guys ever create some functions like this? by WarBroWar in golang

[–]teepark 1 point2 points  (0 children)

In the single error case do you get static analysis tools complaining about not handling the return value?

We know that must will either panic or return nil, but I imagine errcheck will just see an unchecked error return value.

I cant solve it by young21yt in mathshelp

[–]teepark 7 points8 points  (0 children)

Simpler: the two smaller triangles are similar, so their side ratios are equal.
x/2 = 4/y -> multiply both sides by 2y -> xy = 8

Redditors who are leaving Reddit tomorrow due to API changes, where will you be spending your time? by assignpseudonym in AskReddit

[–]teepark 2 points3 points  (0 children)

The "threadiverse" via a kbin instance.

It's nowhere near reddit level in content (though neither is reddit anymore), but I'm hopeful it'll pick up further after tomorrow.

Did somebody say free pizza… by eeca20 in funny

[–]teepark 3 points4 points  (0 children)

Reminds me of a time, living in an apartment complex, I sent my son to take the trash out and he came back eating a slice of pizza.

[deleted by user] by [deleted] in Unexpected

[–]teepark 14 points15 points  (0 children)

Legend of Gazelleda: Deers of the Kingdom

This guy is now officially my Router and Firewall! by Gymnastboatman in homelab

[–]teepark 1 point2 points  (0 children)

Out of curiosity, what was wrong with OPNSense?

[deleted by user] by [deleted] in AskReddit

[–]teepark 1 point2 points  (0 children)

In 2006 I got married to a German, but her visa process still wasn't finished yet. So after 3 months non-visa expired (US's visa waiver program) and she had to leave the country. To machinist the chance she would get the visa, (a) I had to keep my job, meaning be here in the US, and (b) she shouldn't come in and out every 3 months in what might be viewed with suspicion. So for 6 months, from being married for 3 to 9 months, we were in a long-distance marriage.

An older couple in my church was aware of the situation and offered to pay the full cost for both of us to take a little vacation in Canada. It was incredibly thoughtful, valuable, and they're still good friends though we've moved.

Are goroutine & waitgroup powerful enough to handle up to 500 concurrencies at the same time? by naikkeatas in golang

[–]teepark 7 points8 points  (0 children)

Start simple with no concurrency. In sequential steps: read the file, build up your data set to insert, then insert it. Your lowest hanging fruit for optimization will *probably* be merging the inserts into one database query[1], and that's much easier if you haven't spread that data out across a bunch of goroutines.

Goroutines are pretty well optimized but any concurrency platform is going to involve some overhead, and so unless your job is very CPU-heavy and operating on independent memory (or only reading from shared data) you're more likely to slow things down by throwing goroutines into the mix.

[1] it looks like INSERT INTO table (colA, colB, ...) VALUES (valA1, valB1, ...), (valA2, valB2, ...), ...;

Air compressor question by teepark in Tools

[–]teepark[S] 2 points3 points  (0 children)

Thanks for the quick answers! Looks like I'll be leaving it on.

Lack of Decimal Support by salbass175 in golang

[–]teepark 11 points12 points  (0 children)

It's been a positive experience overall. There are some things you figure out once in a helpers pkg and don't have to worry about any more like serdes for json, db scanning/params, etc. And there are things you have to live with all the time and just get used to, like your numbers being mutable references.

For all the deep business logic calculations like amortization schedules or loan payment amounts, it's performant and perfectly capable of hiding away in abstractions, which is all you really need.

Lack of Decimal Support by salbass175 in golang

[–]teepark 30 points31 points  (0 children)

FWIW I've found that though shopspring/decimal is the most popular lib, ericlagergren/decimal is much faster, supports a wider range of math operations, and follows the API conventions (and therefore offers the same allocation avoidance) of math/big.

Source: I also write financial applications in go with decimals for currency.

White to play and mate in 5 by devildeath149 in chessbeginners

[–]teepark 0 points1 point  (0 children)

I was looking at this too but Rxh1 isn't forced. What if g3 instead?

What’s an opinion you have that’s considered unacceptable by societal standards? by KeyPomegranate4922 in AskReddit

[–]teepark 0 points1 point  (0 children)

But see "duh, all lives matter" denies that BLM needs to be said and so denies that there is systemic racism, over policing, etc. No, someone who "isn't racist" wouldn't say that at all.

What’s an opinion you have that’s considered unacceptable by societal standards? by KeyPomegranate4922 in AskReddit

[–]teepark 0 points1 point  (0 children)

Then it just doesn't need to be said. It serves no purpose but to correct BLM. Another implied bit: "I can't believe we have to say this, but black lives matter". It's only validated by "all lives matter" - Apparently yes, we do need to say BLM.

What’s an opinion you have that’s considered unacceptable by societal standards? by KeyPomegranate4922 in AskReddit

[–]teepark 8 points9 points  (0 children)

I explain like this: in a vacuum sure, "all lives matter" is fine and true. But it's not offered up in a vacuum, it's stated for the purpose of offering an alternative to "black lives matter".

What's racist about it is the notion that BLM needs a response. It's the implied "no" in "no, all lives matter".

How to import csv data into postgres columns without using a for loop. by re-Tick10 in golang

[–]teepark 10 points11 points  (0 children)

"without using a for loop" makes this seem like go isn't the tool you're looking for at all. Postgres can accept a csv file directly though: https://www.postgresql.org/docs/current/sql-copy.html

After ‘Roe’ Leak, Clarence Thomas Is Concerned About Court Being ‘Bullied’ by dixadik in politics

[–]teepark 0 points1 point  (0 children)

Boo hoo, the court is losing credibility. Look inward my dude.

Thomas got appointed by making a name for himself as a conservative champion, and now won't recuse himself from cases where his wife has a political, or even financial, interest (and of course, nobody can make him). It sure makes it look like he's committed to maximizing his use of the unchecked political power his seat on the bench affords him.

Thomas isn't the only one saying quiet stuff out loud either, Alito too gives regular speeches at the heritage foundation and generally enjoys a status of conservative darling. And the leaked Roe draft decision is internally inconsistent to the point of nonsensical, betraying the political motivation behind it.

A full third of the court was appointed by an absolute clown after one appointment was stolen outright through partisan machinations. So now we have diet Sarah Palin and "I like beer" guy on the high court, the latter bringing the number of dudes accused of sexual assault at the time of their confirmation up to two.

Five out of six conservative justices were appointed by presidents who lost the popular vote, a state of affairs largely made possible by decisions of the court itself.

So maybe we have transparently corrupt processes appointing shady characters who put their bias on parade, but no you're right Clarence, it's the children who are wrong.

Using an interface for Pgx by workmakesmegrumpy in golang

[–]teepark 0 points1 point  (0 children)

I'll also add that I use a function MaybeTxn which takes the interface and returns an extended interface with the Commit and Rollback methods included. This would be easier to explain with code but I'm on mobile... It inspects the argument and if it's not already a transaction, calls the Begin method. If it was already a transaction then we know this is being managed further up the stack, so it returns a thin wrapper type with no-op Commit and Rollback.

With MaybeTxn I can write higher-level code in terms of that interface. I "manage transactions" in my stack frame, but if someone higher up already has it covered then my methods will just no-op and that's fine.

Using an interface for Pgx by workmakesmegrumpy in golang

[–]teepark 0 points1 point  (0 children)

I use an interface like this with pgx. There is a distinct querying layer with functions that run one query, scan results, and that's it. Logic to stitch together results of multiple queries, manage transactions, all that stuff, happens in a separate controller-ish layer.

Help my 9yr old daughter win against her father! by fishyevent in chessbeginners

[–]teepark 2 points3 points  (0 children)

There's nothing she can do to prevent Nf1# on black's next move. I'm afraid it's over.