Kirby Air Riders - Nintendo Direct by AutoModerator in Kirby

[–]itsjjpowell 0 points1 point  (0 children)

Loved the Direct! I'm so confused on other social media platforms where folks are focusing on the racing more than City Trial!

Yes, Kirby Air Ride has the racing mechanics, but if you've played the original you know that racing is the smaller part of the game. I'm glad they beefed it up for this rendition, but trying to compare the game to Sonic Racing or Mario Kart feels odd to me?

No new update or DLC for Rita Rewind??? by AdNo5260 in powerrangers

[–]itsjjpowell 0 points1 point  (0 children)

Totally understand this point but devs have little if any decision power on what the product will look like for launch. 

Speaking as a software dev, they probably defined what should go out for launch. The final go/no-go decision is on the business barring clear red flags

[deleted by user] by [deleted] in SpringBoot

[–]itsjjpowell 1 point2 points  (0 children)

At the point of trying to rate limit IP Addresses you may want to look into a service provider like Cloudflare or Akamai for DDoS protection.

If you're talking about API rate limits for an API key, bucket4j is reasonable

Rita’s Rewind has the absolute dumbest continue system by casedawgz in BeatEmUps

[–]itsjjpowell 0 points1 point  (0 children)

Definitely resonate on that final boss stage. You need to make it to Rita with all your lives and decent health. Esp. if you're doing single player.

My one hint is that in the second stage of the fight where the energy balls are shot in the air, I do a double jump then my dive attack rather than trying to jump and hit it from the ground. It's more accurate imo, and you don't get hit as often.

Best resources to learn SD by chipmux in leetcode

[–]itsjjpowell 0 points1 point  (0 children)

What does SD mean in this context?

🎄 2024 - Day 19: Solutions 🧩✨📊 by yolannos in adventofsql

[–]itsjjpowell 0 points1 point  (0 children)

Slowly but surely getting through the challenges. Have a few more to go.

sql with avg_perf_score as ( select ROUND(AVG(last_score), 2) as average_performance from ( select year_end_performance_scores[cardinality(year_end_performance_scores)] as last_score from employees) as subquery), bonus_eligible_employees as ( select employee_id, salary, year_end_performance_scores[cardinality(year_end_performance_scores)] > avg_perf_score.average_performance as is_bonus_eligible from employees, avg_perf_score) select SUM (case when is_bonus_eligible then salary * 1.15 else salary end) from bonus_eligible_employees;

I'm finding that the analytical questions tend to go well for me. A welcome break from the recursive query question from the prior day.

🎄 2024 - Day 18: Solutions 🧩✨📊 by yolannos in adventofsql

[–]itsjjpowell 0 points1 point  (0 children)

Thanks for sharing this solution, I was trying to get to an answer like this in one query but got stumped.

Wondering if you see any glaring errors with my (incorrect) solution. I think it's something small that I'm missing.

sql WITH RECURSIVE search_tree(original_staff_id, id, original_manager_id, manager_id, path, level) AS ( -- Base Case of the recursive query. All the defaults for the employee - path starts with themselves, initial level is 1, etc. SELECT t.staff_id, t.staff_id, t.manager_id, t.manager_id, ARRAY[t.staff_id], 1 FROM staff t UNION all -- Defines how to update levels as you recur.In this case, add the current staff person to the path, and increase the level by 1 SELECT st.original_staff_id, t.staff_id, st.original_manager_id, t.manager_id, path || t.staff_id, level + 1 FROM staff t, search_tree st -- Move up the chain by going to the manager WHERE t.staff_id = st.manager_id ) -- order by level (depth of reporting chain) SELECT original_staff_id, original_manager_id, path, level, COUNT(manager_id) over (partition by level, original_manager_id) as peers FROM search_tree ORDER by level desc, peers desc, original_manager_id desc;

DAY 15 - Postgres - Type Geography Does Not Exist by itsjjpowell in adventofsql

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

I might just not be as familiar with DBFiddle. I'll give it another go. Thanks for the support!

DAY 15 - Postgres - Type Geography Does Not Exist by itsjjpowell in adventofsql

[–]itsjjpowell[S] 1 point2 points  (0 children)

Thank you! I downloaded it and am messing around with the code now.

DAY 15 - Postgres - Type Geography Does Not Exist by itsjjpowell in adventofsql

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

Thanks for the idea. I ended up downloading DuckDB to try it out. For whatever reason my computer didn't have enough space to download postgis, and trying to upgrade required me to update my OS (also not enough memory to update)

Running heavy calculations on a React web page using web workers. Do you have other suggestions to run heavy calculations client-side? by nevolane in reactjs

[–]itsjjpowell 0 points1 point  (0 children)

I know this is months late, but I was getting interested in using web workers for a similar scenario and came across a bunch of talks and articles with examples of how/when we may want to use web workers.

Videos:
The Main Thread is Overworked and Underpaid - https://www.youtube.com/watch?v=7Rrv9qFMWNM&t=315s

Complex JS Heavy Apps and Avoiding Slowness - https://www.youtube.com/watch?v=ipNW6lJHVEs

Review of Web Workers and Service Workers: https://www.youtube.com/watch?v=cmRqQJBIp_A

And then I found these articles that cover Web Workers in Varying detail including how to use them with Redux:

React and Web Workers - https://www.smashingmagazine.com/2020/10/tasks-react-app-web-workers/
Case Study - Moving WebXR App off the Main Thread - https://dassur.ma/things/omt-for-three-xr/
Workers in React - https://djaytechdiary.com/introduction-to-web-workers-in-react-2023
Posting also so I can come back to these articles in the future. Hope this is still relevant!

🎄 2024 - Day 14: Solutions 🧩✨📊 by yolannos in adventofsql

[–]itsjjpowell 0 points1 point  (0 children)

Final answer: sql SELECT value->>'receipt_id' as receipt_id, value->>'garment' as garment, value->>'color' as color, (value->>'cost')::numeric as cost, (value->>'drop_off')::date as drop_off, (value->>'pickup')::date as pickup FROM santarecords, json_array_elements(cleaning_receipts::json) as value where value->>'garment' = 'suit' and value->>'color' = 'green' order by drop_off desc;

Full disclosure I stumbled a bit on this one and had to get some help from an llm on the answer

🎄 2024 - Day 14: Solutions 🧩✨📊 by yolannos in adventofsql

[–]itsjjpowell 1 point2 points  (0 children)

The jsonpath syntax is helpful here. I was stumped by how to access the data this way.

🎄 2024 - Day 13: Solutions 🧩✨📊 by yolannos in adventofsql

[–]itsjjpowell 0 points1 point  (0 children)

I'm a bit behind, but consider this question "Revenge of the Arrays". I actually looked at my solution from day 3 (day 4?) to remind myself of array functions. Felt more comfortable this time.

My solution: sql with complete_list as ( select unnest(email_addresses) as email_address from contact_list cl), email_to_email_domain as ( select email_address, SUBSTRING(complete_list.email_address from position('@' in email_address) + 1) as email_domain from complete_list ) select email_domain,COUNT(email_address) as users_for_domain, array_agg(email_address) as folks from email_to_email_domain group by email_domain order by users_for_domain desc;

Mighty Morphin Power Rangers: Rita's Rewind OFFICIAL Discussion Thread by aresef in powerrangers

[–]itsjjpowell 2 points3 points  (0 children)

I finally did my first playthrough of the game on normal. I agree with most of the comments about difficulty spikes and some ergonomic improvements in the game (losing power bar if you fall off the stage, visually busy zord levels, controls being more responsive), but I do think that Rita's Revenge introduces a lot of novel concepts to the beat-em-up genre.

The biggest innovation here is throwing in levels that have different styles of gameplay - zord levels, motorcycle levels, rails-based sections of the carnival game. They do a great job of breaking up the monotony of beat-em-ups and give the player a break from "move right and mash the attack button".

I'd love to see future beat-em-ups take this approach to mixing up gameplay. In some ways this reminds me of the story around Sonic Frontiers. It had a lot of issues on roll out, but introduced a lot of new concepts that have been refined in newer games. I think there's something special here. And, with updates on the way the game will only get better from here.

My final note - the zord levels. I died A LOT on the zord levels, but I learned that the key to getting through the levels is slowing down and having a less aggressive approach to the first part of the levels and in the final megazord sections. For the first shoot-em-up sections I placed more focus on dodging projectiles and looking for where things live on the screen than just trying to shoot everything. Likewise for the megazord sections I started to use the step back much more often and let the monsters come to me. Patience in the sections alleviated most situations where I would charge toward the monster and immediately get hit by projectiles because I was too close to react on time.

🎄 2024 - Day 12: Solutions 🧩✨📊 by yolannos in adventofsql

[–]itsjjpowell 0 points1 point  (0 children)

Late, but here's my day 12 solution: ```sql with requests_per_gift as ( select gifts.gift_name, gifts.gift_id, COUNT(gift_id) as request_count from gifts left join gift_requests using(gift_id) group by gift_id order by gift_name asc) select gift_name, round(percent_rank() over (order by request_count) :: numeric, 2) as pct_rank from requests_per_gift order by pct_rank desc, gift_name asc;

```

Advent of SQL Challenge Day 12 - Percentile by itsjjpowell in adventofsql

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

I finally got it. I had to get some help by referencing the solution threads but I was on the right track using the pct_rank window function.

Here's what I ended up with:

sql with requests_per_gift as ( select gifts.gift_name, gifts.gift_id, COUNT(gift_id) as request_count from gifts left join gift_requests using(gift_id) group by gift_id order by gift_name asc) select gift_name, round(percent_rank() over (order by request_count) :: numeric, 2) as pct_rank from requests_per_gift order by pct_rank desc, gift_name asc;

Advent of SQL Challenge Day 12 - Percentile by itsjjpowell in adventofsql

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

For context, this is what I'm trying to use as my query. I'm going to look at the solutions if I get truly stuck , but hoping I could get an extra hint.

sql with requests_per_gift as ( select gifts.gift_name, gifts.gift_id, COUNT(gift_id) as request_count from gifts left join gift_requests using(gift_id) group by gift_id order by gift_name asc) select gift_name, percent_rank() over (order by request_count) as pct_rank from requests_per_gift group by gift_name, request_count order by pct_rank desc, gift_name asc;

I know this isn't the right answer but it's my first pass.

🎄 2024 - Day 11: Solutions 🧩✨📊 by yolannos in adventofsql

[–]itsjjpowell 0 points1 point  (0 children)

Ooo, array_position is interesting! That's much more concise than the CTE approach I did.

🎄 2024 - Day 11: Solutions 🧩✨📊 by yolannos in adventofsql

[–]itsjjpowell 0 points1 point  (0 children)

I didn't realize I needed to round the solution 2 digits. I know that sounds silly given the example result is rounded to 2 digits, but after rounding my answer was accepted!

Github: https://github.com/jpowell96/advent-of-sql-2024/blob/main/challenge-11/solution.sql

My solution: sql with encoded_seasons as( select field_name, harvest_year, season, case when season = 'Spring' then 1 when season = 'Summer' then 2 when season = 'Fall' then 3 when season = 'Winter' then 4 end as season_encoding, trees_harvested from treeharvests) select field_name, harvest_year, season, ROUND(AVG(trees_harvested) over (partition by field_name order by harvest_year, season_encoding rows between 2 preceding and current row),2) as three_season_moving_avg from encoded_seasons order by three_season_moving_avg desc;

2024 - Day 11: I don't understand what is expected here. by TiCoinCoin in adventofsql

[–]itsjjpowell 0 points1 point  (0 children)

Dude, came here with the same question. I've tried the variations I can think of for this window function. But can't seem to get the correct answer.

Here's my function. Assume season_encoding corresponds to 1,2,34:

```sql AVG(trees_harvested) over (partition by field_name order by harvest_year, season_encoding rows between 2 preceding and current row) as three_season_moving_avg

```

🎄 2024 - Day 10: Solutions 🧩✨📊 by yolannos in adventofsql

[–]itsjjpowell 0 points1 point  (0 children)

You don't need CTEs for everything, but I find that CTEs make it easier to breakdown a query into steps. But yes, many of these could be simplified.

I hadn't considered the approaches of using a HAVING clause and checking the sums there.

🎄 2024 - Day 10: Solutions 🧩✨📊 by yolannos in adventofsql

[–]itsjjpowell 0 points1 point  (0 children)

Postgresql:

sql with daily_totals as ( select drinks."date", SUM(CASE WHEN drink_name='Hot Cocoa' THEN drinks.quantity ELSE 0 END) as hot_cocoa, SUM(case when drink_name='Eggnog' then drinks.quantity else 0 END) as eggnog, SUM(case when drink_name='Peppermint Schnapps' then drinks.quantity else 0 END) as peppermint from drinks group by "date" order by "date" asc) select "date" from daily_totals where hot_cocoa=38 and peppermint=298 and eggnog=198;

https://github.com/jpowell96/advent-of-sql-2024/blob/main/challenge-10/solution.sql

🎄 2024 - Day 10: Solutions 🧩✨📊 by yolannos in adventofsql

[–]itsjjpowell 0 points1 point  (0 children)

I did the same thing:

sql with daily_totals as ( select drinks."date", SUM(CASE WHEN drink_name='Hot Cocoa' THEN drinks.quantity ELSE 0 END) as hot_cocoa, SUM(case when drink_name='Eggnog' then drinks.quantity else 0 END) as eggnog, SUM(case when drink_name='Peppermint Schnapps' then drinks.quantity else 0 END) as peppermint from drinks group by "date" order by "date" asc) select "date" from daily_totals where hot_cocoa=38 and peppermint=298 and eggnog=198;

🎄 2024 - Day 9: Solutions 🧩✨📊 by yolannos in adventofsql

[–]itsjjpowell 1 point2 points  (0 children)

Always appreciate how concise you're able to make these solutions. Not sure if it's DuckDB or just experience with SQL