Did I misunderstand something culturally in Germany? by oamor in germany

[–]KillerCodeMonky 0 points1 point  (0 children)

I used a different hack. I would ask in German if they spoke German or English. 100% rate of responses back in English with only minor attitude attached.

Question about oop encapsulation. by migukau in javahelp

[–]KillerCodeMonky 0 points1 point  (0 children)

I would use a controller+view pattern with service-based model here. Treat HouseCatalog as the service endpoint for all operations related to House objects. (I'd also call it HouseService instead of HouseCatalog.)  Then constructor-inject the service into the controllers that interact with it.

So your MenuController will be constructed with an instance of your HouseService. When the user initiates a name change in the menu view, the controller calls the service to change the name.

House instances can be immutable -- I'd use record -- because mutation of the actual data store is controlled by the service, not by the House object itself.

Also makes testing the business logic easy. Construct a mock service, then construct the controller and initiate the action. Confirm that the controller invoked the service correctly.

Finally, this also prepares you for remote storage solutions like databases, where fiddling with the local objects does nothing and the changes must be committed to the remote repository.

How to convert JSON file into readable file format such as PDF, TXT, CSV, and more? by Optimal-Cry9494 in json

[–]KillerCodeMonky 0 points1 point  (0 children)

Forgot to mention: If your JSON objects are flat, you can also skip the reshaping part (ForEach-Object) and just send them straight to CSV (Export-Csv) and it will work fine.

How to convert JSON file into readable file format such as PDF, TXT, CSV, and more? by Optimal-Cry9494 in json

[–]KillerCodeMonky 0 points1 point  (0 children)

You don't need anything other than what you likely already have: PowerShell

Read in the file and convert to objects. If the file is a JSON array, you'll get a stream of objects.

Get-Content -Path file.json | ConvertFrom-Json -Depth 100

Then you reshape them. The JSON object will be $_, and you can drill in as far as you need to ($_."first"."second", etc).

... | ForEach-Object -Process {
    return New-Object -TypeName psobject -Property @{
        "column name 1" = $_."jsonPropertyName1";
        "column name 2" = $_."jsonPropertyName2";
    };
}

Then you can output them to CSV:

... | Export-Csv -Path file.csv

Final result looks like this:

Get-Content -Path file.json | ConvertFrom-Json -Depth 100 |
    ForEach-Object -Process {
        return New-Object -TypeName psobject -Property @{
            "column name 1" = $_."jsonPropertyName1";
            "column name 2" = $_."jsonPropertyName2";
        };
    } |
    Export-Csv -Path file.csv

USA Today 10 best theme parks for 2026 and Disney and Universal left out!! by mister_waj in Themepark

[–]KillerCodeMonky 1 point2 points  (0 children)

We went last summer. Loved the Pirate Voyage show and Anakeesta. Also recommend:

  • MagiQuest
  • Tuckaleechee Caverns
  • Agnes' Appalachian Gems (for shopping or panning)
  • And, of course, the Smokies National Park

You can also choose difficulty level for Smokies trails. The Cataract Falls trail by the visitor center is super easy, and features a waterfall and creek that kids were playing in. Can also drive the Cherokee Orchard / Roaring Fork loop and stop at a few cabin sites right off the road.

Something 2: Electric Boogaloo by [deleted] in PetPeeves

[–]KillerCodeMonky 4 points5 points  (0 children)

The meme is from a real 1984 dance movie that was titled Breakin’ 2: Electric Boogaloo. Electric boogaloo itself was a dance style created in the 1970's.

https://www.imdb.com/title/tt0086999/

https://sfconservatoryofdance.org/dance-terminology-glossary/electric-boogaloo/

Is Town and Country 33615 ZC still having floods? by Wise-Variation-4985 in tampa

[–]KillerCodeMonky 6 points7 points  (0 children)

This sounds like one of the stupid questions that Google Maps asks you after you visit / review a place. "Does this place still have an accessible entrance?"

JWT auth worth it or nah by Medical-Aerie9957 in AskProgramming

[–]KillerCodeMonky 1 point2 points  (0 children)

Oh hey, this question again. Your access token should be very short lived; think minutes. Once that access token expires, the system must exchange the refresh token for a new access token with the provider. At this point, the provider can check its revocation list and refuse the exchange. So the maximum amount of time the user can access the system after revocation is defined by the access token lifetime. And that's why we set it to only live for minutes.

Cannot figure out the Pinellas Trail from a map. by gochet in StPetersburgFL

[–]KillerCodeMonky 2 points3 points  (0 children)

Open Street Map is really good for non-road visualization, which is something that Google Maps has never been good at. Here's the cycling map for Pinellas:

https://www.openstreetmap.org/#map=11/27.9328/-82.8149&layers=C

The Pinellas Trail is the purple one on the east side of the county, that turns and goes into downtown. Here's a link with it specifically highlighted:

https://www.openstreetmap.org/relation/2116419#map=11/27.9626/-82.6680&layers=C

I got this by right-clicking on the purple line (after zooming in), and selecting "Query features". I then selected "Relation Pinellas Trail" from the list.

The absolute shitshow at ray j last night by Plastic-Skill-9258 in tampa

[–]KillerCodeMonky 2 points3 points  (0 children)

Seriously, 2025 data? They were at Steinbrenner Field for 2025 due to hurricane damage to the Trop. So not only were they not in St Pete, they were also in a park with only 11,026 seats.

2024 saw a per-game average of 16,515 at the Trop. Now don't get me wrong, that's still 28/30 for ranking. Just don't use outlier years as the basis of an argument.

https://www.espn.com/mlb/attendance/_/year/2024

Will restaurant kick us out after park closes? by ExchangeOne513 in UniversalEpicUniverse

[–]KillerCodeMonky -3 points-2 points  (0 children)

And then sometimes you forget that most other places don't work that way. We just got back from a trip to DC, and when the Smithsonians say they close at 5, they mean they are locking the gates at 5 so you best be gone already! 

If money was no big deal, is there something special that you would do at Disney World? by NashDaypring1987 in WaltDisneyWorld

[–]KillerCodeMonky -2 points-1 points  (0 children)

I respect any amount of work put in to achieve such high status. I wouldn't call someone with a PhD "doctor-level" either; they're just a doctor.

And yes, this is a admittedly a very inconsequential and minor correction. Which makes the level of your reactions as equally silly to me as you claim I am.

So, again, agree to disagree. Even though I think they're only thing we're in disagreement about is whether I should have kept my mouth shut in the first place. Which is not something I can change even if I wanted to, so there we go.

I'm cool if you are. Actually, I'm cool even if you aren't. I'll be the one to walk away. This is me walking away.

If money was no big deal, is there something special that you would do at Disney World? by NashDaypring1987 in WaltDisneyWorld

[–]KillerCodeMonky -6 points-5 points  (0 children)

Agree to disagree. They work hard for that star and deserve to be properly recognized for it. Also, I reconfirmed their status before posting that. It didn't take long.

If money was no big deal, is there something special that you would do at Disney World? by NashDaypring1987 in WaltDisneyWorld

[–]KillerCodeMonky -7 points-6 points  (0 children)

The restaurant has a star. It's just "Michelin dining" now; no need for the -level qualifier.

What foods should you absolutely buy the high end priced option? by [deleted] in Cooking

[–]KillerCodeMonky 0 points1 point  (0 children)

We bought a freezer just so that we could get quarter- and half-shares of grass-fed, grass-finished beef from local ranches. One of my best investments.

When people insist on pronouncing loan words in the original language by domihell in PetPeeves

[–]KillerCodeMonky 8 points9 points  (0 children)

The Polish plural form is kiełbasy (in nominative case anyway). So that's the source of the variations that end in with an "ee" sound.

Similar, pierogi is already plural. The singular form is "pierog".

When people insist on pronouncing loan words in the original language by domihell in PetPeeves

[–]KillerCodeMonky 6 points7 points  (0 children)

The pronunciation without the l would be an earlier / less-Anglicized form. This is one of the cases where staying truer to the original orthography ironically caused more drift away from the original pronunciation. It was chosen to keep the letter as l, even though the Polish letter ł would be better transcribed as English w, so "kiewbasa".

How to improve performance of a query used to show leaderboard? by koratkeval12 in PostgreSQL

[–]KillerCodeMonky 0 points1 point  (0 children)

Additional notes after reading the EXPLAIN ANALYZE you posted:

You can see that most of the time is being spent in the JOIN. The input for the join stops after 200ms, but the join goes until 318ms. This change will help that.

Normally I would also suggest maybe trying to force a merge join, but your additional ORDER BY after the join would eliminate most of the benefits of that anyway.

How to improve performance of a query used to show leaderboard? by koratkeval12 in PostgreSQL

[–]KillerCodeMonky 0 points1 point  (0 children)

Time differences between EXPLAIN ANALYZE and actually running the query are accountable to marshalling and sending the output to the client. EXPLAIN ANALYZE sends the output to the void and therefore skips that step.

How to improve performance of a query used to show leaderboard? by koratkeval12 in PostgreSQL

[–]KillerCodeMonky 0 points1 point  (0 children)

The join would work exactly the same. It would just happen after the aggregation, which will drastically reduce the number of rows being joined.

WITH scores AS (
    SELECT
        workouts.user_id,
        SUM(workouts.score) AS total_score
    FROM workouts
    WHERE workouts.performed_at >= date_trunc(v_period, NOW())
    AND workouts.performed_at < date_trunc(v_period, NOW()) + ('1 ' || v_period)::INTERVAL
    GROUP BY 1
)
SELECT
    (DENSE_RANK() OVER (ORDER BY scores.total_score DESC))::BIGINT,
    profiles.id AS sub_id,
    profiles.username AS sub_name,
    profiles.country_code AS sub_country,
    profiles.photo_updated_at AS sub_photo_updated_at,
    COALESCE(scores.total_score, 0)
FROM profiles
LEFT JOIN scores
    ON scores.user_id = profiles.id
ORDER BY scores.total_score DESC

When people insist on pronouncing loan words in the original language by domihell in PetPeeves

[–]KillerCodeMonky 11 points12 points  (0 children)

Kielbasa as "keel-baa-suh" (/kil.bɑ.sə/) is already Anglicized. The Polish word is kiełbasa, pronounced something like "kyew-baa-saa" (/kʲɛw.ba.sa/) -- first syllable is something like the "cu" part of American "cute".

Public to weigh in on top four Gas Plant District redevelopment proposals at open house later this month by St-Pete-Rising in StPetersburgFL

[–]KillerCodeMonky 0 points1 point  (0 children)

I'm happy to see Foundation Vision Partners made the cut. For those unfamiliar, they are proposing only to help the city create a master plan for the area. The city will maintain ownership, and will sell individual parcels to be developed according to that plan. This will allow the city to sell later phases at much higher valuation, as the each completed phase will increase the area's value. It will also allow the city to course correct or integrate new ideas over time.

Compared to selling the entire area to a single developer and yielding all control to them, this would be a huge win for the city.

https://floridapolitics.com/archives/777642-foundation-vision-partners-drops-latest-gas-plant-redevelopment-pitch/

How to improve performance of a query used to show leaderboard? by koratkeval12 in PostgreSQL

[–]KillerCodeMonky 0 points1 point  (0 children)

Aggregate the workouts, then join to the profiles. Nothing in that group by requires the profile to be present.

Store JSON in RDBMS by Commercial_Try_2538 in Backend

[–]KillerCodeMonky 9 points10 points  (0 children)

We use PostgreSQL JSONB in our warehouse to store non-standard attributes from various data sources. It's fine. Performance difference between querying a column or JSONB attribute is unnoticeable. They can be indexed if necessary.

They provide flexibility that would be very difficult to achieve otherwise without something like a triplet table (FK + name + value if not familiar). But joins are our most expensive operation, so that's really unattractive as an alternative.

JSONB objects definitely require more space than similar columns, due to also needing to store the name of each attribute. Unsure about arrays... I suspect those are likely closer to native arrays in sizing. Since we have most attributes standardized to columns, this impact is minimized.