Monthly summary of active users based on a start/end date roster

I have a table that dictates who was on a project, from a startdate to an enddate. I’d like some help writing a query that will return the number of "active" users at the end of every month, for the past 12 months.

CREATE TABLE `roster` (   `id` int(11) NOT NULL,   `user_id` int(11) DEFAULT NULL,   `project_id` int(11) DEFAULT NULL,   `start_date` datetime NOT NULL,   `end_date` datetime NOT NULL,   `closed_date` datetime DEFAULT NULL,   PRIMARY KEY (`id`) ); 
id  user_id project_id  start_date  end_date    closed_date 1   1   1   2019-05-27 00:00:00 2021-02-01 00:00:00 NULL 2   2   2   2020-05-27 00:00:00 2021-02-01 00:00:00 2020-02-05 00:00:00 3   3   3   2020-05-27 00:00:00 2024-02-01 00:00:00 2020-02-05 00:00:00 

And the result would be something that shows how many distinct users had an active project within each month (only since the start of this year).

So for the dataset above, we can see that all 3 projects were "active" in the month January 2021, because the end date is in the future.

2020-01-31 | 3 

The last bit of complexity is that sometimes a project can be closed before the EndDate and I’d like to exclude any users who’s endDate is in the future but the project has actually closed.

For example in the dataset above, the third project has a end date of Feb 2024, however the project closed in Feb 2021. So technically the person was active in 2021 Jan and Feb, but not March.

p.s Hoping to get an answer in Postgres (I’m using Redshift)

Should I keep running my old projects as Active, Or just Verify

Greetings, friends.
Wondering if I should keep running some of my oldest set of GSA projects as active…and not just set to Verify only…
I mean those oldest projects where I just link to my money site directly with SER.
I don’t think I need to stop running old projects where SER creates links at T2 T3 .. .. just those pointing RIGHT at the  money site.
…and JUST those projects, of course, that I have newer replacements for with my own T1s, either on PBNs, a few legit listings, and various social media and other content platforms, and hopefully some authority links.
Is it ever OK to link directly to a money site with SER?
I have Asia Virtual Solutions active, blog comment, directory, forum, guestbook,Image COntent, Microblog, Pingback, Referrer, RSS, Social Bookmarks, Trackbacks, Web 2.0, Wiki running.
I also have a separate set of older projects that post to anything that will accept an article pointing at the money site. The articles are OK. Spun, hand-written, reviewed spintax for accuracy. On those I have Asia Virtual Solutions (projects to MS that use articles), articles, blog comments, pingbacks,referrers, social bookmarks, social networks, and wikis that use articles when posting.
This is how I chose to set up older projects. Are *either* the first set of projects, or the second that use articles,  appropriate as a T1 pointing at  a money site? And if not, what SHOULD I be using SER-generated backlinks? I’m *SURE* some will suggest SEREngines. I’ve haven’t used SEREngines since the last version, so if someone could explain I would very much appreciate it. Trying to do SEO right, finally. No more continuing poor practices that are just from a time I didn’t know better.
Should I *NOT* have been doing this? Is it considered “spam practices” by Google? At some point, I came to to understand that T1s should be stable and basically be legit. Is it OK?

WordPress add page under admin submenu and retaining the active status of the parent submenu page in the menu

I have added a page in the admin menu(pxmag-menu) and a submenu(pxmag-plans). There is another page(pxmag-plans-edit) set under the submenu(pxmag-plans) as the parent page.

public function __construct() {     require('pxMagAdminPlans.class.php');     $  this->admPlanObj= new pxMagAdminPlans();      add_action('admin_menu', array($  this, 'add_plan_admin_menu')); }  public function add_plan_admin_menu() {     add_menu_page(__('Dashboard', 'textdomain'), get_bloginfo('name'), 'manage_options', 'pxmag-menu', array($  this, 'pxmag_dash'), 'dashicons-welcome-view-site', 6);              add_submenu_page('pxmag-menu', __('Subscription Plans', 'textdomain'), 'Plans', 'manage_options', 'pxmag-plans', array($  this->admPlanObj, 'plan_admin_menu_page'));     add_submenu_page('pxmag-plans', __('Add/edit Plans', 'textdomain'), 'Add/edit plans', 'manage_options', 'pxmag-plans-edit', array($  this->admPlanObj, 'plan_admin_menu_edit')); } 

All the menu and submenu pages load fine.

But, when I open this page(pxmag-plans-edit), the menu selection in the WordPress admin shows nothing as current item, whereas the pxmag-plans is supposed to be the current selection.

(It is supposed to work like: when I click ‘Posts > Categories‘ and subsequently open the ‘edit category‘ page, the ‘Posts > Categories‘ option in menu keeps selected).

What is going wrong? What is the correct process?

Can I have two castings of minor illusion active at the same time?

I had made a new half-elf sorcerer who will soon be a rogue multi-class. His spells are based off of what a rogue would choose them to be, such as fog cloud, mage hand, and minor illusion. In addition, I chose prestidigitation in the hopes of combining with minor illusion, using one for sound and one for an image.

Yet it was never clear to me if I could just use minor illusion twice, as it is a cantrip. This will free up a cantrip spot for a more offensive spell, seeing as all of my other spells are more ability than offense. We are playing D&D 5E.

Can I have two castings of minor illusion active at the same time?

facetwp leave all filters active across all pages, archives or single post

I will be quick and precise, I created a real estate site, I used the facetwp solution not very difficult to understand and with a rich documentation and hooks. I think I have everything in front of me but I need some help to understand which one. I’m still learning.

I put the links at the bottom.

the problem I can’t figure out which hook to use to basically tell facetwp to leave all filters active across all pages, archives or single post of properties , ignore post category, taxonomies, not auto-detect filters ,the header filters must remain the same everywhere

I have attached an illustration


How to Customize WordPress Archive Queries

80 hooks available wich one i can use ?

they talk about that too :" Instead of creating an entirely separate query, we recommend using WP’s pre_get_posts filter to modify the existing query."

update 26/10/2020

I updated the image to illustrate the problem.

I still haven’t figured out what to do.. I hope it’s clear and at least someone understands the problem.

enter image description here

Trouble diagnosing an AdSense Viewability / Active View issue

I’m having a viewability issue with a vertical Adsense placement (300×600 and under).

It’s a pretty standard above-the-fold, right column placement. The top of the placement starts around 200 px from the top of the browser window, so it’s a very visible placement. Easily the most visible on the site for desktop users.

The placement is hidden in mobile (by hiding the parent per current AdSense regulations) and doesn’t serve to mobile devices. (This is tested and confirmed, btw… so that’s not the issue).

The placement is currently scoring a meager 30% Active View in AdSense reports, which means it’s serving and not being seen — a lot.

Where else should I be looking to diagnose this problem? I’m pretty sure the viewability issue is negatively impacting RPM.

The site has excellent traction, with over 6 ppv and an average pageview time of nearly 1 minute. The bounce rate is a very healthy 33%. The CWV on the page are all healthy (Rather, as healthy as can be expected with a site running AdSense).

Anyone familiar with viewability / active view issues? Any thoughts on where else the issue could lie?


What happens when a dying abjurer with an Arcane Ward active is attacked?

An abjuration wizard has the Arcane Ward class feature (PHB, p. 115):

Starting at 2nd level, you can weave magic around yourself for protection. When you cast an abjuration spell of 1st level or higher, you can simultaneously use a strand of the spell’s magic to create a magical ward on yourself that lasts until you finish a long rest. The ward has hit points equal to twice your wizard level + your Intelligence modifier. Whenever you take damage, the ward takes the damage instead. If this damage reduces the ward to 0 hit points, you take any remaining damage.

If an abjurer is dropped to 0 hit points by means other than damage (such as by failing a saving throw against a Banshee’s Wail), their Arcane Ward remains active (assuming it was active before). What happens if they are attacked whilst dying?

  • They take a step towards death; the rules on Damage at 0 hit points don’t take the Arcane Ward into account;
  • The Arcane Ward continues to "block" damage, so the ward would need to be reduce to 0 hit points/the damage exceed the ward’s hit point before it counts as the wizard taking damage at 0 hit points. Hence if the ward had 10 hit points and a monster dealt 5 hit points, the wizard would not suffer any failed death saving throws;
  • Both of the above; the Arcane Ward would continue to absorb damage, which may be relevant for death by massive damage, but the wizard would still suffer failed saving throws anyway);