kandi background
Explore Kits

donations | Supports Google Play Store | Cryptocurrency library

 by   SufficientlySecure Java Version: Current License: Apache-2.0

 by   SufficientlySecure Java Version: Current License: Apache-2.0

Download this library from

kandi X-RAY | donations Summary

donations is a Java library typically used in Blockchain, Cryptocurrency, Bitcoin applications. donations has no bugs, it has build file available, it has a Permissive License and it has high support. However donations has 1 vulnerabilities. You can download it from GitHub.
Android Donations Lib supports donations by Google Play Store, Flattr, PayPal, and Bitcoin. It is used in projects, such as OpenKeychain, AdAway, FasterGPS, and NTPSync.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • donations has a highly active ecosystem.
  • It has 342 star(s) with 97 fork(s). There are 43 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 6 open issues and 24 have been closed. On average issues are closed in 76 days. There are 2 open pull requests and 0 closed requests.
  • It has a negative sentiment in the developer community.
  • The latest version of donations is current.
donations Support
Best in #Cryptocurrency
Average in #Cryptocurrency
donations Support
Best in #Cryptocurrency
Average in #Cryptocurrency

quality kandi Quality

  • donations has 0 bugs and 0 code smells.
donations Quality
Best in #Cryptocurrency
Average in #Cryptocurrency
donations Quality
Best in #Cryptocurrency
Average in #Cryptocurrency

securitySecurity

  • donations has 1 vulnerability issues reported (0 critical, 0 high, 1 medium, 0 low).
  • donations code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
donations Security
Best in #Cryptocurrency
Average in #Cryptocurrency
donations Security
Best in #Cryptocurrency
Average in #Cryptocurrency

license License

  • donations is licensed under the Apache-2.0 License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
donations License
Best in #Cryptocurrency
Average in #Cryptocurrency
donations License
Best in #Cryptocurrency
Average in #Cryptocurrency

buildReuse

  • donations releases are not available. You will need to build from source code and install.
  • Build file is available. You can build the component from source.
  • Installation instructions, examples and code snippets are available.
  • donations saves you 1046 person hours of effort in developing the same functionality from scratch.
  • It has 2373 lines of code, 111 functions and 54 files.
  • It has high code complexity. Code complexity directly impacts maintainability of the code.
donations Reuse
Best in #Cryptocurrency
Average in #Cryptocurrency
donations Reuse
Best in #Cryptocurrency
Average in #Cryptocurrency
Top functions reviewed by kandi - BETA

kandi has reviewed donations and discovered the below as its top functions. This is intended to give you an instant insight into donations implemented functionality, and help decide if they suit your requirements.

  • Builds the views .
    • Build the fl attribute .
      • Handles an activity result from an activity .
        • Starts the IAB setup .
          • Encodes 3 to 4 bytes .
            • Decodes a 4 byte array into 4 bytes .
              • Verify a signature .
                • region Admin
                  • Verify that signed data matches signed data .
                    • Overrides the default implementation of this method to be overridden by subclasses .

                      Get all kandi verified functions for this library.

                      Get all kandi verified functions for this library.

                      donations Key Features

                      Donations library for Android. Supports Google Play Store, Flattr, PayPal, and Bitcoin

                      How to use

                      copy iconCopydownload iconDownload
                      repositories {
                          jcenter()
                      }
                      
                      dependencies {
                          compile 'org.sufficientlysecure:donations:2.6'
                      }
                      

                      ModuleNotFoundError makes no sense

                      copy iconCopydownload iconDownload
                      python -m standalone.sockets
                      

                      Requests object not filtering correctly

                      copy iconCopydownload iconDownload
                      listly = [s for s in listly if "https://exrx.net" in s or "../../" in listly]
                      
                      from bs4 import BeautifulSoup
                      from urllib.request import Request, urlopen
                      
                      req = Request("http://exrx.net/Lists/ExList/NeckWt")
                      page_source = urlopen(req)
                      
                      soup = BeautifulSoup(page_source , "lxml")
                      
                      links = []
                      for link in soup.findAll('a'):
                          links.append(link.get('href'))
                      

                      When I run nest.js, I get a Missing "driver" option error

                      copy iconCopydownload iconDownload
                      @Module({
                        imports: [
                          GraphQLModule.forRoot<ApolloDriverConfig>({
                            driver: ApolloDriver,
                          }),
                        ],
                      })
                      

                      web3 JS payment button for Metamask BSC bep20 token

                      copy iconCopydownload iconDownload
                      (async ()=>{
                              const contract = new web3.eth.Contract(ABI, contractAddress);
                              if(window.ethereum.chainId == '0x38'){
                                await contract.methods.transfer(reciever, 10)
                                .send('from':ethereum.selectedAddress)
                                .on('receipt',(receipt)=>{console.log(receipt)})
                              } else {
                                ethereum.request({ method: 'wallet_switchEthereumChain', params:[{chainId: '0x38'}]})
                              }
                      })()
                      
                      

                      Issue with preparing dataset for use with ggalluvial and creating alluvial diagram

                      copy iconCopydownload iconDownload
                      library(dplyr)
                      #> 
                      #> Attaching package: 'dplyr'
                      #> The following objects are masked from 'package:stats':
                      #> 
                      #>     filter, lag
                      #> The following objects are masked from 'package:base':
                      #> 
                      #>     intersect, setdiff, setequal, union
                      library(stringr)
                      library(ggalluvial)
                      #> Loading required package: ggplot2
                      
                      df <- structure(list(
                        donor_ID = c("1", "2", "3", "1", "2", "3", "1", "2", "3", "1"),
                        recip_name = c("B, P", "S, B", "K, A", "H, K", "W, E", "S, B", "C, J", "B, J", "W, E", "S, B"),
                        donation_amt = c(25, 27, 50, 100, 3, 9, 25, 50, 400, 20),
                        month_year = c("September 2019", "July 2019", "June 2019", "April 2019", "December 2019", "August 2019", "September 2019", "October 2019", "August 2019", "December 2019")
                      ), class = "data.frame", row.names = c(NA, -10L))
                      df$recip_name <- as.factor(df$recip_name)
                      
                      is_lodes_form(df, key = month_year, value = recip_name, id = donor_ID)
                      #> Duplicated id-axis pairings.
                      #> [1] FALSE
                      
                      df %>%
                        slice(-c(7, 9)) %>%
                        mutate(month = match(str_remove(month_year, " 2019"), month.name)) %>%
                        ggplot(aes(x = month_year, y = donation_amt, stratum = recip_name,
                                   alluvium = donor_ID, fill = recip_name, label = recip_name)) +
                        scale_fill_brewer(type = "qual", palette = "Set2") +
                        geom_flow(stat = "alluvium", color = "darkgray") +
                        geom_stratum() +
                        theme_light() +
                        theme(legend.position = "bottom") +
                        ggtitle("Donor Preference")
                      

                      Regex not matching in Fastify route

                      copy iconCopydownload iconDownload
                      const fastify = require('fastify')({ logger: true })
                      
                      const handler = async (request, reply) => {
                        return { hello: request.params.foo }
                      }
                      
                      fastify.get('/listings/:foo(^(donations|skills|blogs)$)', handler)
                      fastify.listen(8080)
                      
                      fastify.get('/listings/donations)', handler)
                      fastify.get('/listings/skills)', handler)
                      fastify.get('/listings/blogs', handler)
                      
                      ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬─────────┬─────────┐
                      │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev   │ Min     │
                      ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
                      │ Req/Sec   │ 68863   │ 68863   │ 75327   │ 75839   │ 73678.55 │ 2791.45 │ 68860   │
                      ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
                      │ Bytes/Sec │ 12.5 MB │ 12.5 MB │ 13.7 MB │ 13.8 MB │ 13.4 MB  │ 507 kB  │ 12.5 MB │
                      └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴─────────┴─────────┘
                      
                      ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬─────────┬─────────┐
                      │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev   │ Min     │
                      ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
                      │ Req/Sec   │ 86015   │ 86015   │ 95423   │ 95551   │ 94350.55 │ 2681.36 │ 85954   │
                      ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
                      │ Bytes/Sec │ 15.6 MB │ 15.6 MB │ 17.4 MB │ 17.4 MB │ 17.2 MB  │ 491 kB  │ 15.6 MB │
                      └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴─────────┴─────────┘
                      
                      const fastify = require('fastify')({ logger: true })
                      
                      const handler = async (request, reply) => {
                        return { hello: request.params.foo }
                      }
                      
                      fastify.get('/listings/:foo(^(donations|skills|blogs)$)', handler)
                      fastify.listen(8080)
                      
                      fastify.get('/listings/donations)', handler)
                      fastify.get('/listings/skills)', handler)
                      fastify.get('/listings/blogs', handler)
                      
                      ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬─────────┬─────────┐
                      │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev   │ Min     │
                      ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
                      │ Req/Sec   │ 68863   │ 68863   │ 75327   │ 75839   │ 73678.55 │ 2791.45 │ 68860   │
                      ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
                      │ Bytes/Sec │ 12.5 MB │ 12.5 MB │ 13.7 MB │ 13.8 MB │ 13.4 MB  │ 507 kB  │ 12.5 MB │
                      └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴─────────┴─────────┘
                      
                      ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬─────────┬─────────┐
                      │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev   │ Min     │
                      ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
                      │ Req/Sec   │ 86015   │ 86015   │ 95423   │ 95551   │ 94350.55 │ 2681.36 │ 85954   │
                      ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
                      │ Bytes/Sec │ 15.6 MB │ 15.6 MB │ 17.4 MB │ 17.4 MB │ 17.2 MB  │ 491 kB  │ 15.6 MB │
                      └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴─────────┴─────────┘
                      
                      const fastify = require('fastify')({ logger: true })
                      
                      const handler = async (request, reply) => {
                        return { hello: request.params.foo }
                      }
                      
                      fastify.get('/listings/:foo(^(donations|skills|blogs)$)', handler)
                      fastify.listen(8080)
                      
                      fastify.get('/listings/donations)', handler)
                      fastify.get('/listings/skills)', handler)
                      fastify.get('/listings/blogs', handler)
                      
                      ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬─────────┬─────────┐
                      │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev   │ Min     │
                      ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
                      │ Req/Sec   │ 68863   │ 68863   │ 75327   │ 75839   │ 73678.55 │ 2791.45 │ 68860   │
                      ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
                      │ Bytes/Sec │ 12.5 MB │ 12.5 MB │ 13.7 MB │ 13.8 MB │ 13.4 MB  │ 507 kB  │ 12.5 MB │
                      └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴─────────┴─────────┘
                      
                      ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬─────────┬─────────┐
                      │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev   │ Min     │
                      ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
                      │ Req/Sec   │ 86015   │ 86015   │ 95423   │ 95551   │ 94350.55 │ 2681.36 │ 85954   │
                      ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
                      │ Bytes/Sec │ 15.6 MB │ 15.6 MB │ 17.4 MB │ 17.4 MB │ 17.2 MB  │ 491 kB  │ 15.6 MB │
                      └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴─────────┴─────────┘
                      
                      const fastify = require('fastify')({ logger: true })
                      
                      const handler = async (request, reply) => {
                        return { hello: request.params.foo }
                      }
                      
                      fastify.get('/listings/:foo(^(donations|skills|blogs)$)', handler)
                      fastify.listen(8080)
                      
                      fastify.get('/listings/donations)', handler)
                      fastify.get('/listings/skills)', handler)
                      fastify.get('/listings/blogs', handler)
                      
                      ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬─────────┬─────────┐
                      │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev   │ Min     │
                      ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
                      │ Req/Sec   │ 68863   │ 68863   │ 75327   │ 75839   │ 73678.55 │ 2791.45 │ 68860   │
                      ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
                      │ Bytes/Sec │ 12.5 MB │ 12.5 MB │ 13.7 MB │ 13.8 MB │ 13.4 MB  │ 507 kB  │ 12.5 MB │
                      └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴─────────┴─────────┘
                      
                      ┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬─────────┬─────────┐
                      │ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg      │ Stdev   │ Min     │
                      ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
                      │ Req/Sec   │ 86015   │ 86015   │ 95423   │ 95551   │ 94350.55 │ 2681.36 │ 85954   │
                      ├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼─────────┼─────────┤
                      │ Bytes/Sec │ 15.6 MB │ 15.6 MB │ 17.4 MB │ 17.4 MB │ 17.2 MB  │ 491 kB  │ 15.6 MB │
                      └───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴─────────┴─────────┘
                      

                      How do I include multiple entities in one row in Linq?

                      copy iconCopydownload iconDownload
                      class Member
                      {
                          public int Id {get; set;}
                          public string Name {get; set;}
                          ... // other columns
                      
                          // Every Member has made zero or more Donations (one-to-many)
                          public virtual ICollection<Donation> Donations {get; set;}
                      }
                      
                      class Donation
                      {
                          public int Id {get; set;}
                          public DateTime Date {get; set;}
                          public decimal Amount {get; set;}
                          ... // other columns
                      
                          // Every Donations is made by exactly one Member, using foreign key
                          public int MemberId {get; set;}
                          public virtual Member Member {get; set;}
                      }
                      
                      public DonationContext : DbContext
                      {
                          public DbSet<Member> Members {get; set;}
                          public DbSet<Donation> Donations {get; set;}
                      
                          ... // other tables
                      }
                      
                      int year = 2021;
                      var result = dbContext.Members.Select(member => new
                      {
                          Name = member.Name,
                      
                          // keep only the Donations of 2021
                          Donations = member.Donations.Where(donation => donation.Year == year)
                      
                              // Make groups of Donations that has the same Month:
                              .GroupBy(donation => donation.Date.Month,
                      
                                  // parameter resultSelector:
                                  // from every Month, and all Donations made in this Month, make one new
                                  (month, donationsInThisMonth) => new
                                  {
                                      Month = new DateTime(year, month, 1),
                                      Total = donationsInThisMonth.Select(donation => donation.Amount)
                                                                  .Sum(),
                                  })
                                  .ToList(),
                      });
                      
                      var result = dbContext.Members.Select(member => new
                      {
                          Name = member.Name,
                          Donations = member.Donations.Where(donation => donation.Year == year)
                              .GroupBy(donation => donation.Date.Month,
                                  (month, donationsInThisMonth) => new
                                  {
                                      Month = new DateTime(year, month, 1),
                                      Total = donationsInThisMonth
                                          .Select(donation => donation.Amount)
                                          .Sum(),
                                  })
                                  .ToList(),
                      });
                      
                      int year = 2021;
                      
                      // Use GroupJoin to get the Members with their Donations
                      var result = dbContext.Members.GroupJoin(dbContext.Donations,
                      
                      member => member.Id,             // from every Member get the primary key
                      donation => donation.MemberId,   // from every Donation get the foreign key to Member
                      
                      // parameter resultSelector:
                      // for every Member, and all his zero or more Donations, make one new
                      (member, donationsOfThisMember) => new
                      {
                          Name = member.Name,
                      
                          // the rest is similar to the solution above
                          Donations = donationsOfThisMember.Where(donation => donation.Year == year)
                              .GroupBy(donation => donation.Date.Month,
                                  (month, donationsInThisMonth) => new
                                  {
                                      Month = new DateTime(year, month, 1),
                                      Total = donationsInThisMonth
                                          .Select(donation => donation.Amount)
                                          .Sum(),
                                  })
                                  .ToList(),
                      });
                      
                      DateTime today = DateTime.Today.
                      DateTime yearAgo = today.AddMonths(-12);
                      DateTime firstMonth = new DateTime(yearAgo.Year, yearAgo.Month, 1);
                      DateTime nextMonth = new DateTime(today.Year, today.Month, 1);
                      // nextMonth is the first one not displayed; TODO: invent a proper name
                      
                      Donations = donationsOfThisMember
                          .Where(donation => donation.Date >= firstMonth && donation.Date < nextMonth)
                          .GroupBy(... etc
                      
                      class MonthlyDonation
                      {
                          public DateTime Month {get; set;}
                          public decimal Total {get; set;}
                      }
                      
                      class MemberWithMonthlyDonations
                      {
                          public string Name {get; set;}
                          ... // other Member properties that you want
                      
                          List<MonthlyDonation> Donations {get; set;}
                      }
                      
                      public static IEnumerable<MonthlyDonation> AddEmptyDonations(
                          this IEnumerable<MonthlyDonation> source,
                          DateTime firstMonth,
                          DateTime nextMonth)
                      {
                          // todo: check source not null
                          var monthlyDonations = source.ToDictionary(donation => donation.Month);
                          DateTime month = firstMonth
                          while (month < nextMonth)
                          {
                              if (monthlyDonations.TryGetValue(month, out MonthlyDonation donation))
                              {
                                  // a Donation from the database
                                  yield return donation;
                              }
                              else
                              {
                                  // this month no donation in the database
                                  yield return new MonthlyDonation
                                  {
                                      Month = month,
                                      Total = 0.0M,
                                  };
                              }
                              month = month.AddMonths(+1);
                         }
                      }
                      
                      IEnumerable<MemberWithMonthlyDonations> fetchedFromDatabase = ...
                      
                      IEnumerable<MemeberWithMonthlyDonations> result = fetchedFromDataBase
                          .AddEmptyDonations(firstMonth, nextMonth);
                      
                      class Member
                      {
                          public int Id {get; set;}
                          public string Name {get; set;}
                          ... // other columns
                      
                          // Every Member has made zero or more Donations (one-to-many)
                          public virtual ICollection<Donation> Donations {get; set;}
                      }
                      
                      class Donation
                      {
                          public int Id {get; set;}
                          public DateTime Date {get; set;}
                          public decimal Amount {get; set;}
                          ... // other columns
                      
                          // Every Donations is made by exactly one Member, using foreign key
                          public int MemberId {get; set;}
                          public virtual Member Member {get; set;}
                      }
                      
                      public DonationContext : DbContext
                      {
                          public DbSet<Member> Members {get; set;}
                          public DbSet<Donation> Donations {get; set;}
                      
                          ... // other tables
                      }
                      
                      int year = 2021;
                      var result = dbContext.Members.Select(member => new
                      {
                          Name = member.Name,
                      
                          // keep only the Donations of 2021
                          Donations = member.Donations.Where(donation => donation.Year == year)
                      
                              // Make groups of Donations that has the same Month:
                              .GroupBy(donation => donation.Date.Month,
                      
                                  // parameter resultSelector:
                                  // from every Month, and all Donations made in this Month, make one new
                                  (month, donationsInThisMonth) => new
                                  {
                                      Month = new DateTime(year, month, 1),
                                      Total = donationsInThisMonth.Select(donation => donation.Amount)
                                                                  .Sum(),
                                  })
                                  .ToList(),
                      });
                      
                      var result = dbContext.Members.Select(member => new
                      {
                          Name = member.Name,
                          Donations = member.Donations.Where(donation => donation.Year == year)
                              .GroupBy(donation => donation.Date.Month,
                                  (month, donationsInThisMonth) => new
                                  {
                                      Month = new DateTime(year, month, 1),
                                      Total = donationsInThisMonth
                                          .Select(donation => donation.Amount)
                                          .Sum(),
                                  })
                                  .ToList(),
                      });
                      
                      int year = 2021;
                      
                      // Use GroupJoin to get the Members with their Donations
                      var result = dbContext.Members.GroupJoin(dbContext.Donations,
                      
                      member => member.Id,             // from every Member get the primary key
                      donation => donation.MemberId,   // from every Donation get the foreign key to Member
                      
                      // parameter resultSelector:
                      // for every Member, and all his zero or more Donations, make one new
                      (member, donationsOfThisMember) => new
                      {
                          Name = member.Name,
                      
                          // the rest is similar to the solution above
                          Donations = donationsOfThisMember.Where(donation => donation.Year == year)
                              .GroupBy(donation => donation.Date.Month,
                                  (month, donationsInThisMonth) => new
                                  {
                                      Month = new DateTime(year, month, 1),
                                      Total = donationsInThisMonth
                                          .Select(donation => donation.Amount)
                                          .Sum(),
                                  })
                                  .ToList(),
                      });
                      
                      DateTime today = DateTime.Today.
                      DateTime yearAgo = today.AddMonths(-12);
                      DateTime firstMonth = new DateTime(yearAgo.Year, yearAgo.Month, 1);
                      DateTime nextMonth = new DateTime(today.Year, today.Month, 1);
                      // nextMonth is the first one not displayed; TODO: invent a proper name
                      
                      Donations = donationsOfThisMember
                          .Where(donation => donation.Date >= firstMonth && donation.Date < nextMonth)
                          .GroupBy(... etc
                      
                      class MonthlyDonation
                      {
                          public DateTime Month {get; set;}
                          public decimal Total {get; set;}
                      }
                      
                      class MemberWithMonthlyDonations
                      {
                          public string Name {get; set;}
                          ... // other Member properties that you want
                      
                          List<MonthlyDonation> Donations {get; set;}
                      }
                      
                      public static IEnumerable<MonthlyDonation> AddEmptyDonations(
                          this IEnumerable<MonthlyDonation> source,
                          DateTime firstMonth,
                          DateTime nextMonth)
                      {
                          // todo: check source not null
                          var monthlyDonations = source.ToDictionary(donation => donation.Month);
                          DateTime month = firstMonth
                          while (month < nextMonth)
                          {
                              if (monthlyDonations.TryGetValue(month, out MonthlyDonation donation))
                              {
                                  // a Donation from the database
                                  yield return donation;
                              }
                              else
                              {
                                  // this month no donation in the database
                                  yield return new MonthlyDonation
                                  {
                                      Month = month,
                                      Total = 0.0M,
                                  };
                              }
                              month = month.AddMonths(+1);
                         }
                      }
                      
                      IEnumerable<MemberWithMonthlyDonations> fetchedFromDatabase = ...
                      
                      IEnumerable<MemeberWithMonthlyDonations> result = fetchedFromDataBase
                          .AddEmptyDonations(firstMonth, nextMonth);
                      
                      class Member
                      {
                          public int Id {get; set;}
                          public string Name {get; set;}
                          ... // other columns
                      
                          // Every Member has made zero or more Donations (one-to-many)
                          public virtual ICollection<Donation> Donations {get; set;}
                      }
                      
                      class Donation
                      {
                          public int Id {get; set;}
                          public DateTime Date {get; set;}
                          public decimal Amount {get; set;}
                          ... // other columns
                      
                          // Every Donations is made by exactly one Member, using foreign key
                          public int MemberId {get; set;}
                          public virtual Member Member {get; set;}
                      }
                      
                      public DonationContext : DbContext
                      {
                          public DbSet<Member> Members {get; set;}
                          public DbSet<Donation> Donations {get; set;}
                      
                          ... // other tables
                      }
                      
                      int year = 2021;
                      var result = dbContext.Members.Select(member => new
                      {
                          Name = member.Name,
                      
                          // keep only the Donations of 2021
                          Donations = member.Donations.Where(donation => donation.Year == year)
                      
                              // Make groups of Donations that has the same Month:
                              .GroupBy(donation => donation.Date.Month,
                      
                                  // parameter resultSelector:
                                  // from every Month, and all Donations made in this Month, make one new
                                  (month, donationsInThisMonth) => new
                                  {
                                      Month = new DateTime(year, month, 1),
                                      Total = donationsInThisMonth.Select(donation => donation.Amount)
                                                                  .Sum(),
                                  })
                                  .ToList(),
                      });
                      
                      var result = dbContext.Members.Select(member => new
                      {
                          Name = member.Name,
                          Donations = member.Donations.Where(donation => donation.Year == year)
                              .GroupBy(donation => donation.Date.Month,
                                  (month, donationsInThisMonth) => new
                                  {
                                      Month = new DateTime(year, month, 1),
                                      Total = donationsInThisMonth
                                          .Select(donation => donation.Amount)
                                          .Sum(),
                                  })
                                  .ToList(),
                      });
                      
                      int year = 2021;
                      
                      // Use GroupJoin to get the Members with their Donations
                      var result = dbContext.Members.GroupJoin(dbContext.Donations,
                      
                      member => member.Id,             // from every Member get the primary key
                      donation => donation.MemberId,   // from every Donation get the foreign key to Member
                      
                      // parameter resultSelector:
                      // for every Member, and all his zero or more Donations, make one new
                      (member, donationsOfThisMember) => new
                      {
                          Name = member.Name,
                      
                          // the rest is similar to the solution above
                          Donations = donationsOfThisMember.Where(donation => donation.Year == year)
                              .GroupBy(donation => donation.Date.Month,
                                  (month, donationsInThisMonth) => new
                                  {
                                      Month = new DateTime(year, month, 1),
                                      Total = donationsInThisMonth
                                          .Select(donation => donation.Amount)
                                          .Sum(),
                                  })
                                  .ToList(),
                      });
                      
                      DateTime today = DateTime.Today.
                      DateTime yearAgo = today.AddMonths(-12);
                      DateTime firstMonth = new DateTime(yearAgo.Year, yearAgo.Month, 1);
                      DateTime nextMonth = new DateTime(today.Year, today.Month, 1);
                      // nextMonth is the first one not displayed; TODO: invent a proper name
                      
                      Donations = donationsOfThisMember
                          .Where(donation => donation.Date >= firstMonth && donation.Date < nextMonth)
                          .GroupBy(... etc
                      
                      class MonthlyDonation
                      {
                          public DateTime Month {get; set;}
                          public decimal Total {get; set;}
                      }
                      
                      class MemberWithMonthlyDonations
                      {
                          public string Name {get; set;}
                          ... // other Member properties that you want
                      
                          List<MonthlyDonation> Donations {get; set;}
                      }
                      
                      public static IEnumerable<MonthlyDonation> AddEmptyDonations(
                          this IEnumerable<MonthlyDonation> source,
                          DateTime firstMonth,
                          DateTime nextMonth)
                      {
                          // todo: check source not null
                          var monthlyDonations = source.ToDictionary(donation => donation.Month);
                          DateTime month = firstMonth
                          while (month < nextMonth)
                          {
                              if (monthlyDonations.TryGetValue(month, out MonthlyDonation donation))
                              {
                                  // a Donation from the database
                                  yield return donation;
                              }
                              else
                              {
                                  // this month no donation in the database
                                  yield return new MonthlyDonation
                                  {
                                      Month = month,
                                      Total = 0.0M,
                                  };
                              }
                              month = month.AddMonths(+1);
                         }
                      }
                      
                      IEnumerable<MemberWithMonthlyDonations> fetchedFromDatabase = ...
                      
                      IEnumerable<MemeberWithMonthlyDonations> result = fetchedFromDataBase
                          .AddEmptyDonations(firstMonth, nextMonth);
                      
                      class Member
                      {
                          public int Id {get; set;}
                          public string Name {get; set;}
                          ... // other columns
                      
                          // Every Member has made zero or more Donations (one-to-many)
                          public virtual ICollection<Donation> Donations {get; set;}
                      }
                      
                      class Donation
                      {
                          public int Id {get; set;}
                          public DateTime Date {get; set;}
                          public decimal Amount {get; set;}
                          ... // other columns
                      
                          // Every Donations is made by exactly one Member, using foreign key
                          public int MemberId {get; set;}
                          public virtual Member Member {get; set;}
                      }
                      
                      public DonationContext : DbContext
                      {
                          public DbSet<Member> Members {get; set;}
                          public DbSet<Donation> Donations {get; set;}
                      
                          ... // other tables
                      }
                      
                      int year = 2021;
                      var result = dbContext.Members.Select(member => new
                      {
                          Name = member.Name,
                      
                          // keep only the Donations of 2021
                          Donations = member.Donations.Where(donation => donation.Year == year)
                      
                              // Make groups of Donations that has the same Month:
                              .GroupBy(donation => donation.Date.Month,
                      
                                  // parameter resultSelector:
                                  // from every Month, and all Donations made in this Month, make one new
                                  (month, donationsInThisMonth) => new
                                  {
                                      Month = new DateTime(year, month, 1),
                                      Total = donationsInThisMonth.Select(donation => donation.Amount)
                                                                  .Sum(),
                                  })
                                  .ToList(),
                      });
                      
                      var result = dbContext.Members.Select(member => new
                      {
                          Name = member.Name,
                          Donations = member.Donations.Where(donation => donation.Year == year)
                              .GroupBy(donation => donation.Date.Month,
                                  (month, donationsInThisMonth) => new
                                  {
                                      Month = new DateTime(year, month, 1),
                                      Total = donationsInThisMonth
                                          .Select(donation => donation.Amount)
                                          .Sum(),
                                  })
                                  .ToList(),
                      });
                      
                      int year = 2021;
                      
                      // Use GroupJoin to get the Members with their Donations
                      var result = dbContext.Members.GroupJoin(dbContext.Donations,
                      
                      member => member.Id,             // from every Member get the primary key
                      donation => donation.MemberId,   // from every Donation get the foreign key to Member
                      
                      // parameter resultSelector:
                      // for every Member, and all his zero or more Donations, make one new
                      (member, donationsOfThisMember) => new
                      {
                          Name = member.Name,
                      
                          // the rest is similar to the solution above
                          Donations = donationsOfThisMember.Where(donation => donation.Year == year)
                              .GroupBy(donation => donation.Date.Month,
                                  (month, donationsInThisMonth) => new
                                  {
                                      Month = new DateTime(year, month, 1),
                                      Total = donationsInThisMonth
                                          .Select(donation => donation.Amount)
                                          .Sum(),
                                  })
                                  .ToList(),
                      });
                      
                      DateTime today = DateTime.Today.
                      DateTime yearAgo = today.AddMonths(-12);
                      DateTime firstMonth = new DateTime(yearAgo.Year, yearAgo.Month, 1);
                      DateTime nextMonth = new DateTime(today.Year, today.Month, 1);
                      // nextMonth is the first one not displayed; TODO: invent a proper name
                      
                      Donations = donationsOfThisMember
                          .Where(donation => donation.Date >= firstMonth && donation.Date < nextMonth)
                          .GroupBy(... etc
                      
                      class MonthlyDonation
                      {
                          public DateTime Month {get; set;}
                          public decimal Total {get; set;}
                      }
                      
                      class MemberWithMonthlyDonations
                      {
                          public string Name {get; set;}
                          ... // other Member properties that you want
                      
                          List<MonthlyDonation> Donations {get; set;}
                      }
                      
                      public static IEnumerable<MonthlyDonation> AddEmptyDonations(
                          this IEnumerable<MonthlyDonation> source,
                          DateTime firstMonth,
                          DateTime nextMonth)
                      {
                          // todo: check source not null
                          var monthlyDonations = source.ToDictionary(donation => donation.Month);
                          DateTime month = firstMonth
                          while (month < nextMonth)
                          {
                              if (monthlyDonations.TryGetValue(month, out MonthlyDonation donation))
                              {
                                  // a Donation from the database
                                  yield return donation;
                              }
                              else
                              {
                                  // this month no donation in the database
                                  yield return new MonthlyDonation
                                  {
                                      Month = month,
                                      Total = 0.0M,
                                  };
                              }
                              month = month.AddMonths(+1);
                         }
                      }
                      
                      IEnumerable<MemberWithMonthlyDonations> fetchedFromDatabase = ...
                      
                      IEnumerable<MemeberWithMonthlyDonations> result = fetchedFromDataBase
                          .AddEmptyDonations(firstMonth, nextMonth);
                      
                      class Member
                      {
                          public int Id {get; set;}
                          public string Name {get; set;}
                          ... // other columns
                      
                          // Every Member has made zero or more Donations (one-to-many)
                          public virtual ICollection<Donation> Donations {get; set;}
                      }
                      
                      class Donation
                      {
                          public int Id {get; set;}
                          public DateTime Date {get; set;}
                          public decimal Amount {get; set;}
                          ... // other columns
                      
                          // Every Donations is made by exactly one Member, using foreign key
                          public int MemberId {get; set;}
                          public virtual Member Member {get; set;}
                      }
                      
                      public DonationContext : DbContext
                      {
                          public DbSet<Member> Members {get; set;}
                          public DbSet<Donation> Donations {get; set;}
                      
                          ... // other tables
                      }
                      
                      int year = 2021;
                      var result = dbContext.Members.Select(member => new
                      {
                          Name = member.Name,
                      
                          // keep only the Donations of 2021
                          Donations = member.Donations.Where(donation => donation.Year == year)
                      
                              // Make groups of Donations that has the same Month:
                              .GroupBy(donation => donation.Date.Month,
                      
                                  // parameter resultSelector:
                                  // from every Month, and all Donations made in this Month, make one new
                                  (month, donationsInThisMonth) => new
                                  {
                                      Month = new DateTime(year, month, 1),
                                      Total = donationsInThisMonth.Select(donation => donation.Amount)
                                                                  .Sum(),
                                  })
                                  .ToList(),
                      });
                      
                      var result = dbContext.Members.Select(member => new
                      {
                          Name = member.Name,
                          Donations = member.Donations.Where(donation => donation.Year == year)
                              .GroupBy(donation => donation.Date.Month,
                                  (month, donationsInThisMonth) => new
                                  {
                                      Month = new DateTime(year, month, 1),
                                      Total = donationsInThisMonth
                                          .Select(donation => donation.Amount)
                                          .Sum(),
                                  })
                                  .ToList(),
                      });
                      
                      int year = 2021;
                      
                      // Use GroupJoin to get the Members with their Donations
                      var result = dbContext.Members.GroupJoin(dbContext.Donations,
                      
                      member => member.Id,             // from every Member get the primary key
                      donation => donation.MemberId,   // from every Donation get the foreign key to Member
                      
                      // parameter resultSelector:
                      // for every Member, and all his zero or more Donations, make one new
                      (member, donationsOfThisMember) => new
                      {
                          Name = member.Name,
                      
                          // the rest is similar to the solution above
                          Donations = donationsOfThisMember.Where(donation => donation.Year == year)
                              .GroupBy(donation => donation.Date.Month,
                                  (month, donationsInThisMonth) => new
                                  {
                                      Month = new DateTime(year, month, 1),
                                      Total = donationsInThisMonth
                                          .Select(donation => donation.Amount)
                                          .Sum(),
                                  })
                                  .ToList(),
                      });
                      
                      DateTime today = DateTime.Today.
                      DateTime yearAgo = today.AddMonths(-12);
                      DateTime firstMonth = new DateTime(yearAgo.Year, yearAgo.Month, 1);
                      DateTime nextMonth = new DateTime(today.Year, today.Month, 1);
                      // nextMonth is the first one not displayed; TODO: invent a proper name
                      
                      Donations = donationsOfThisMember
                          .Where(donation => donation.Date >= firstMonth && donation.Date < nextMonth)
                          .GroupBy(... etc
                      
                      class MonthlyDonation
                      {
                          public DateTime Month {get; set;}
                          public decimal Total {get; set;}
                      }
                      
                      class MemberWithMonthlyDonations
                      {
                          public string Name {get; set;}
                          ... // other Member properties that you want
                      
                          List<MonthlyDonation> Donations {get; set;}
                      }
                      
                      public static IEnumerable<MonthlyDonation> AddEmptyDonations(
                          this IEnumerable<MonthlyDonation> source,
                          DateTime firstMonth,
                          DateTime nextMonth)
                      {
                          // todo: check source not null
                          var monthlyDonations = source.ToDictionary(donation => donation.Month);
                          DateTime month = firstMonth
                          while (month < nextMonth)
                          {
                              if (monthlyDonations.TryGetValue(month, out MonthlyDonation donation))
                              {
                                  // a Donation from the database
                                  yield return donation;
                              }
                              else
                              {
                                  // this month no donation in the database
                                  yield return new MonthlyDonation
                                  {
                                      Month = month,
                                      Total = 0.0M,
                                  };
                              }
                              month = month.AddMonths(+1);
                         }
                      }
                      
                      IEnumerable<MemberWithMonthlyDonations> fetchedFromDatabase = ...
                      
                      IEnumerable<MemeberWithMonthlyDonations> result = fetchedFromDataBase
                          .AddEmptyDonations(firstMonth, nextMonth);
                      
                      class Member
                      {
                          public int Id {get; set;}
                          public string Name {get; set;}
                          ... // other columns
                      
                          // Every Member has made zero or more Donations (one-to-many)
                          public virtual ICollection<Donation> Donations {get; set;}
                      }
                      
                      class Donation
                      {
                          public int Id {get; set;}
                          public DateTime Date {get; set;}
                          public decimal Amount {get; set;}
                          ... // other columns
                      
                          // Every Donations is made by exactly one Member, using foreign key
                          public int MemberId {get; set;}
                          public virtual Member Member {get; set;}
                      }
                      
                      public DonationContext : DbContext
                      {
                          public DbSet<Member> Members {get; set;}
                          public DbSet<Donation> Donations {get; set;}
                      
                          ... // other tables
                      }
                      
                      int year = 2021;
                      var result = dbContext.Members.Select(member => new
                      {
                          Name = member.Name,
                      
                          // keep only the Donations of 2021
                          Donations = member.Donations.Where(donation => donation.Year == year)
                      
                              // Make groups of Donations that has the same Month:
                              .GroupBy(donation => donation.Date.Month,
                      
                                  // parameter resultSelector:
                                  // from every Month, and all Donations made in this Month, make one new
                                  (month, donationsInThisMonth) => new
                                  {
                                      Month = new DateTime(year, month, 1),
                                      Total = donationsInThisMonth.Select(donation => donation.Amount)
                                                                  .Sum(),
                                  })
                                  .ToList(),
                      });
                      
                      var result = dbContext.Members.Select(member => new
                      {
                          Name = member.Name,
                          Donations = member.Donations.Where(donation => donation.Year == year)
                              .GroupBy(donation => donation.Date.Month,
                                  (month, donationsInThisMonth) => new
                                  {
                                      Month = new DateTime(year, month, 1),
                                      Total = donationsInThisMonth
                                          .Select(donation => donation.Amount)
                                          .Sum(),
                                  })
                                  .ToList(),
                      });
                      
                      int year = 2021;
                      
                      // Use GroupJoin to get the Members with their Donations
                      var result = dbContext.Members.GroupJoin(dbContext.Donations,
                      
                      member => member.Id,             // from every Member get the primary key
                      donation => donation.MemberId,   // from every Donation get the foreign key to Member
                      
                      // parameter resultSelector:
                      // for every Member, and all his zero or more Donations, make one new
                      (member, donationsOfThisMember) => new
                      {
                          Name = member.Name,
                      
                          // the rest is similar to the solution above
                          Donations = donationsOfThisMember.Where(donation => donation.Year == year)
                              .GroupBy(donation => donation.Date.Month,
                                  (month, donationsInThisMonth) => new
                                  {
                                      Month = new DateTime(year, month, 1),
                                      Total = donationsInThisMonth
                                          .Select(donation => donation.Amount)
                                          .Sum(),
                                  })
                                  .ToList(),
                      });
                      
                      DateTime today = DateTime.Today.
                      DateTime yearAgo = today.AddMonths(-12);
                      DateTime firstMonth = new DateTime(yearAgo.Year, yearAgo.Month, 1);
                      DateTime nextMonth = new DateTime(today.Year, today.Month, 1);
                      // nextMonth is the first one not displayed; TODO: invent a proper name
                      
                      Donations = donationsOfThisMember
                          .Where(donation => donation.Date >= firstMonth && donation.Date < nextMonth)
                          .GroupBy(... etc
                      
                      class MonthlyDonation
                      {
                          public DateTime Month {get; set;}
                          public decimal Total {get; set;}
                      }
                      
                      class MemberWithMonthlyDonations
                      {
                          public string Name {get; set;}
                          ... // other Member properties that you want
                      
                          List<MonthlyDonation> Donations {get; set;}
                      }
                      
                      public static IEnumerable<MonthlyDonation> AddEmptyDonations(
                          this IEnumerable<MonthlyDonation> source,
                          DateTime firstMonth,
                          DateTime nextMonth)
                      {
                          // todo: check source not null
                          var monthlyDonations = source.ToDictionary(donation => donation.Month);
                          DateTime month = firstMonth
                          while (month < nextMonth)
                          {
                              if (monthlyDonations.TryGetValue(month, out MonthlyDonation donation))
                              {
                                  // a Donation from the database
                                  yield return donation;
                              }
                              else
                              {
                                  // this month no donation in the database
                                  yield return new MonthlyDonation
                                  {
                                      Month = month,
                                      Total = 0.0M,
                                  };
                              }
                              month = month.AddMonths(+1);
                         }
                      }
                      
                      IEnumerable<MemberWithMonthlyDonations> fetchedFromDatabase = ...
                      
                      IEnumerable<MemeberWithMonthlyDonations> result = fetchedFromDataBase
                          .AddEmptyDonations(firstMonth, nextMonth);
                      
                      class Member
                      {
                          public int Id {get; set;}
                          public string Name {get; set;}
                          ... // other columns
                      
                          // Every Member has made zero or more Donations (one-to-many)
                          public virtual ICollection<Donation> Donations {get; set;}
                      }
                      
                      class Donation
                      {
                          public int Id {get; set;}
                          public DateTime Date {get; set;}
                          public decimal Amount {get; set;}
                          ... // other columns
                      
                          // Every Donations is made by exactly one Member, using foreign key
                          public int MemberId {get; set;}
                          public virtual Member Member {get; set;}
                      }
                      
                      public DonationContext : DbContext
                      {
                          public DbSet<Member> Members {get; set;}
                          public DbSet<Donation> Donations {get; set;}
                      
                          ... // other tables
                      }
                      
                      int year = 2021;
                      var result = dbContext.Members.Select(member => new
                      {
                          Name = member.Name,
                      
                          // keep only the Donations of 2021
                          Donations = member.Donations.Where(donation => donation.Year == year)
                      
                              // Make groups of Donations that has the same Month:
                              .GroupBy(donation => donation.Date.Month,
                      
                                  // parameter resultSelector:
                                  // from every Month, and all Donations made in this Month, make one new
                                  (month, donationsInThisMonth) => new
                                  {
                                      Month = new DateTime(year, month, 1),
                                      Total = donationsInThisMonth.Select(donation => donation.Amount)
                                                                  .Sum(),
                                  })
                                  .ToList(),
                      });
                      
                      var result = dbContext.Members.Select(member => new
                      {
                          Name = member.Name,
                          Donations = member.Donations.Where(donation => donation.Year == year)
                              .GroupBy(donation => donation.Date.Month,
                                  (month, donationsInThisMonth) => new
                                  {
                                      Month = new DateTime(year, month, 1),
                                      Total = donationsInThisMonth
                                          .Select(donation => donation.Amount)
                                          .Sum(),
                                  })
                                  .ToList(),
                      });
                      
                      int year = 2021;
                      
                      // Use GroupJoin to get the Members with their Donations
                      var result = dbContext.Members.GroupJoin(dbContext.Donations,
                      
                      member => member.Id,             // from every Member get the primary key
                      donation => donation.MemberId,   // from every Donation get the foreign key to Member
                      
                      // parameter resultSelector:
                      // for every Member, and all his zero or more Donations, make one new
                      (member, donationsOfThisMember) => new
                      {
                          Name = member.Name,
                      
                          // the rest is similar to the solution above
                          Donations = donationsOfThisMember.Where(donation => donation.Year == year)
                              .GroupBy(donation => donation.Date.Month,
                                  (month, donationsInThisMonth) => new
                                  {
                                      Month = new DateTime(year, month, 1),
                                      Total = donationsInThisMonth
                                          .Select(donation => donation.Amount)
                                          .Sum(),
                                  })
                                  .ToList(),
                      });
                      
                      DateTime today = DateTime.Today.
                      DateTime yearAgo = today.AddMonths(-12);
                      DateTime firstMonth = new DateTime(yearAgo.Year, yearAgo.Month, 1);
                      DateTime nextMonth = new DateTime(today.Year, today.Month, 1);
                      // nextMonth is the first one not displayed; TODO: invent a proper name
                      
                      Donations = donationsOfThisMember
                          .Where(donation => donation.Date >= firstMonth && donation.Date < nextMonth)
                          .GroupBy(... etc
                      
                      class MonthlyDonation
                      {
                          public DateTime Month {get; set;}
                          public decimal Total {get; set;}
                      }
                      
                      class MemberWithMonthlyDonations
                      {
                          public string Name {get; set;}
                          ... // other Member properties that you want
                      
                          List<MonthlyDonation> Donations {get; set;}
                      }
                      
                      public static IEnumerable<MonthlyDonation> AddEmptyDonations(
                          this IEnumerable<MonthlyDonation> source,
                          DateTime firstMonth,
                          DateTime nextMonth)
                      {
                          // todo: check source not null
                          var monthlyDonations = source.ToDictionary(donation => donation.Month);
                          DateTime month = firstMonth
                          while (month < nextMonth)
                          {
                              if (monthlyDonations.TryGetValue(month, out MonthlyDonation donation))
                              {
                                  // a Donation from the database
                                  yield return donation;
                              }
                              else
                              {
                                  // this month no donation in the database
                                  yield return new MonthlyDonation
                                  {
                                      Month = month,
                                      Total = 0.0M,
                                  };
                              }
                              month = month.AddMonths(+1);
                         }
                      }
                      
                      IEnumerable<MemberWithMonthlyDonations> fetchedFromDatabase = ...
                      
                      IEnumerable<MemeberWithMonthlyDonations> result = fetchedFromDataBase
                          .AddEmptyDonations(firstMonth, nextMonth);
                      
                      class Member
                      {
                          public int Id {get; set;}
                          public string Name {get; set;}
                          ... // other columns
                      
                          // Every Member has made zero or more Donations (one-to-many)
                          public virtual ICollection<Donation> Donations {get; set;}
                      }
                      
                      class Donation
                      {
                          public int Id {get; set;}
                          public DateTime Date {get; set;}
                          public decimal Amount {get; set;}
                          ... // other columns
                      
                          // Every Donations is made by exactly one Member, using foreign key
                          public int MemberId {get; set;}
                          public virtual Member Member {get; set;}
                      }
                      
                      public DonationContext : DbContext
                      {
                          public DbSet<Member> Members {get; set;}
                          public DbSet<Donation> Donations {get; set;}
                      
                          ... // other tables
                      }
                      
                      int year = 2021;
                      var result = dbContext.Members.Select(member => new
                      {
                          Name = member.Name,
                      
                          // keep only the Donations of 2021
                          Donations = member.Donations.Where(donation => donation.Year == year)
                      
                              // Make groups of Donations that has the same Month:
                              .GroupBy(donation => donation.Date.Month,
                      
                                  // parameter resultSelector:
                                  // from every Month, and all Donations made in this Month, make one new
                                  (month, donationsInThisMonth) => new
                                  {
                                      Month = new DateTime(year, month, 1),
                                      Total = donationsInThisMonth.Select(donation => donation.Amount)
                                                                  .Sum(),
                                  })
                                  .ToList(),
                      });
                      
                      var result = dbContext.Members.Select(member => new
                      {
                          Name = member.Name,
                          Donations = member.Donations.Where(donation => donation.Year == year)
                              .GroupBy(donation => donation.Date.Month,
                                  (month, donationsInThisMonth) => new
                                  {
                                      Month = new DateTime(year, month, 1),
                                      Total = donationsInThisMonth
                                          .Select(donation => donation.Amount)
                                          .Sum(),
                                  })
                                  .ToList(),
                      });
                      
                      int year = 2021;
                      
                      // Use GroupJoin to get the Members with their Donations
                      var result = dbContext.Members.GroupJoin(dbContext.Donations,
                      
                      member => member.Id,             // from every Member get the primary key
                      donation => donation.MemberId,   // from every Donation get the foreign key to Member
                      
                      // parameter resultSelector:
                      // for every Member, and all his zero or more Donations, make one new
                      (member, donationsOfThisMember) => new
                      {
                          Name = member.Name,
                      
                          // the rest is similar to the solution above
                          Donations = donationsOfThisMember.Where(donation => donation.Year == year)
                              .GroupBy(donation => donation.Date.Month,
                                  (month, donationsInThisMonth) => new
                                  {
                                      Month = new DateTime(year, month, 1),
                                      Total = donationsInThisMonth
                                          .Select(donation => donation.Amount)
                                          .Sum(),
                                  })
                                  .ToList(),
                      });
                      
                      DateTime today = DateTime.Today.
                      DateTime yearAgo = today.AddMonths(-12);
                      DateTime firstMonth = new DateTime(yearAgo.Year, yearAgo.Month, 1);
                      DateTime nextMonth = new DateTime(today.Year, today.Month, 1);
                      // nextMonth is the first one not displayed; TODO: invent a proper name
                      
                      Donations = donationsOfThisMember
                          .Where(donation => donation.Date >= firstMonth && donation.Date < nextMonth)
                          .GroupBy(... etc
                      
                      class MonthlyDonation
                      {
                          public DateTime Month {get; set;}
                          public decimal Total {get; set;}
                      }
                      
                      class MemberWithMonthlyDonations
                      {
                          public string Name {get; set;}
                          ... // other Member properties that you want
                      
                          List<MonthlyDonation> Donations {get; set;}
                      }
                      
                      public static IEnumerable<MonthlyDonation> AddEmptyDonations(
                          this IEnumerable<MonthlyDonation> source,
                          DateTime firstMonth,
                          DateTime nextMonth)
                      {
                          // todo: check source not null
                          var monthlyDonations = source.ToDictionary(donation => donation.Month);
                          DateTime month = firstMonth
                          while (month < nextMonth)
                          {
                              if (monthlyDonations.TryGetValue(month, out MonthlyDonation donation))
                              {
                                  // a Donation from the database
                                  yield return donation;
                              }
                              else
                              {
                                  // this month no donation in the database
                                  yield return new MonthlyDonation
                                  {
                                      Month = month,
                                      Total = 0.0M,
                                  };
                              }
                              month = month.AddMonths(+1);
                         }
                      }
                      
                      IEnumerable<MemberWithMonthlyDonations> fetchedFromDatabase = ...
                      
                      IEnumerable<MemeberWithMonthlyDonations> result = fetchedFromDataBase
                          .AddEmptyDonations(firstMonth, nextMonth);
                      
                      class Member
                      {
                          public int Id {get; set;}
                          public string Name {get; set;}
                          ... // other columns
                      
                          // Every Member has made zero or more Donations (one-to-many)
                          public virtual ICollection<Donation> Donations {get; set;}
                      }
                      
                      class Donation
                      {
                          public int Id {get; set;}
                          public DateTime Date {get; set;}
                          public decimal Amount {get; set;}
                          ... // other columns
                      
                          // Every Donations is made by exactly one Member, using foreign key
                          public int MemberId {get; set;}
                          public virtual Member Member {get; set;}
                      }
                      
                      public DonationContext : DbContext
                      {
                          public DbSet<Member> Members {get; set;}
                          public DbSet<Donation> Donations {get; set;}
                      
                          ... // other tables
                      }
                      
                      int year = 2021;
                      var result = dbContext.Members.Select(member => new
                      {
                          Name = member.Name,
                      
                          // keep only the Donations of 2021
                          Donations = member.Donations.Where(donation => donation.Year == year)
                      
                              // Make groups of Donations that has the same Month:
                              .GroupBy(donation => donation.Date.Month,
                      
                                  // parameter resultSelector:
                                  // from every Month, and all Donations made in this Month, make one new
                                  (month, donationsInThisMonth) => new
                                  {
                                      Month = new DateTime(year, month, 1),
                                      Total = donationsInThisMonth.Select(donation => donation.Amount)
                                                                  .Sum(),
                                  })
                                  .ToList(),
                      });
                      
                      var result = dbContext.Members.Select(member => new
                      {
                          Name = member.Name,
                          Donations = member.Donations.Where(donation => donation.Year == year)
                              .GroupBy(donation => donation.Date.Month,
                                  (month, donationsInThisMonth) => new
                                  {
                                      Month = new DateTime(year, month, 1),
                                      Total = donationsInThisMonth
                                          .Select(donation => donation.Amount)
                                          .Sum(),
                                  })
                                  .ToList(),
                      });
                      
                      int year = 2021;
                      
                      // Use GroupJoin to get the Members with their Donations
                      var result = dbContext.Members.GroupJoin(dbContext.Donations,
                      
                      member => member.Id,             // from every Member get the primary key
                      donation => donation.MemberId,   // from every Donation get the foreign key to Member
                      
                      // parameter resultSelector:
                      // for every Member, and all his zero or more Donations, make one new
                      (member, donationsOfThisMember) => new
                      {
                          Name = member.Name,
                      
                          // the rest is similar to the solution above
                          Donations = donationsOfThisMember.Where(donation => donation.Year == year)
                              .GroupBy(donation => donation.Date.Month,
                                  (month, donationsInThisMonth) => new
                                  {
                                      Month = new DateTime(year, month, 1),
                                      Total = donationsInThisMonth
                                          .Select(donation => donation.Amount)
                                          .Sum(),
                                  })
                                  .ToList(),
                      });
                      
                      DateTime today = DateTime.Today.
                      DateTime yearAgo = today.AddMonths(-12);
                      DateTime firstMonth = new DateTime(yearAgo.Year, yearAgo.Month, 1);
                      DateTime nextMonth = new DateTime(today.Year, today.Month, 1);
                      // nextMonth is the first one not displayed; TODO: invent a proper name
                      
                      Donations = donationsOfThisMember
                          .Where(donation => donation.Date >= firstMonth && donation.Date < nextMonth)
                          .GroupBy(... etc
                      
                      class MonthlyDonation
                      {
                          public DateTime Month {get; set;}
                          public decimal Total {get; set;}
                      }
                      
                      class MemberWithMonthlyDonations
                      {
                          public string Name {get; set;}
                          ... // other Member properties that you want
                      
                          List<MonthlyDonation> Donations {get; set;}
                      }
                      
                      public static IEnumerable<MonthlyDonation> AddEmptyDonations(
                          this IEnumerable<MonthlyDonation> source,
                          DateTime firstMonth,
                          DateTime nextMonth)
                      {
                          // todo: check source not null
                          var monthlyDonations = source.ToDictionary(donation => donation.Month);
                          DateTime month = firstMonth
                          while (month < nextMonth)
                          {
                              if (monthlyDonations.TryGetValue(month, out MonthlyDonation donation))
                              {
                                  // a Donation from the database
                                  yield return donation;
                              }
                              else
                              {
                                  // this month no donation in the database
                                  yield return new MonthlyDonation
                                  {
                                      Month = month,
                                      Total = 0.0M,
                                  };
                              }
                              month = month.AddMonths(+1);
                         }
                      }
                      
                      IEnumerable<MemberWithMonthlyDonations> fetchedFromDatabase = ...
                      
                      IEnumerable<MemeberWithMonthlyDonations> result = fetchedFromDataBase
                          .AddEmptyDonations(firstMonth, nextMonth);
                      
                      class Member
                      {
                          public int Id {get; set;}
                          public string Name {get; set;}
                          ... // other columns
                      
                          // Every Member has made zero or more Donations (one-to-many)
                          public virtual ICollection<Donation> Donations {get; set;}
                      }
                      
                      class Donation
                      {
                          public int Id {get; set;}
                          public DateTime Date {get; set;}
                          public decimal Amount {get; set;}
                          ... // other columns
                      
                          // Every Donations is made by exactly one Member, using foreign key
                          public int MemberId {get; set;}
                          public virtual Member Member {get; set;}
                      }
                      
                      public DonationContext : DbContext
                      {
                          public DbSet<Member> Members {get; set;}
                          public DbSet<Donation> Donations {get; set;}
                      
                          ... // other tables
                      }
                      
                      int year = 2021;
                      var result = dbContext.Members.Select(member => new
                      {
                          Name = member.Name,
                      
                          // keep only the Donations of 2021
                          Donations = member.Donations.Where(donation => donation.Year == year)
                      
                              // Make groups of Donations that has the same Month:
                              .GroupBy(donation => donation.Date.Month,
                      
                                  // parameter resultSelector:
                                  // from every Month, and all Donations made in this Month, make one new
                                  (month, donationsInThisMonth) => new
                                  {
                                      Month = new DateTime(year, month, 1),
                                      Total = donationsInThisMonth.Select(donation => donation.Amount)
                                                                  .Sum(),
                                  })
                                  .ToList(),
                      });
                      
                      var result = dbContext.Members.Select(member => new
                      {
                          Name = member.Name,
                          Donations = member.Donations.Where(donation => donation.Year == year)
                              .GroupBy(donation => donation.Date.Month,
                                  (month, donationsInThisMonth) => new
                                  {
                                      Month = new DateTime(year, month, 1),
                                      Total = donationsInThisMonth
                                          .Select(donation => donation.Amount)
                                          .Sum(),
                                  })
                                  .ToList(),
                      });
                      
                      int year = 2021;
                      
                      // Use GroupJoin to get the Members with their Donations
                      var result = dbContext.Members.GroupJoin(dbContext.Donations,
                      
                      member => member.Id,             // from every Member get the primary key
                      donation => donation.MemberId,   // from every Donation get the foreign key to Member
                      
                      // parameter resultSelector:
                      // for every Member, and all his zero or more Donations, make one new
                      (member, donationsOfThisMember) => new
                      {
                          Name = member.Name,
                      
                          // the rest is similar to the solution above
                          Donations = donationsOfThisMember.Where(donation => donation.Year == year)
                              .GroupBy(donation => donation.Date.Month,
                                  (month, donationsInThisMonth) => new
                                  {
                                      Month = new DateTime(year, month, 1),
                                      Total = donationsInThisMonth
                                          .Select(donation => donation.Amount)
                                          .Sum(),
                                  })
                                  .ToList(),
                      });
                      
                      DateTime today = DateTime.Today.
                      DateTime yearAgo = today.AddMonths(-12);
                      DateTime firstMonth = new DateTime(yearAgo.Year, yearAgo.Month, 1);
                      DateTime nextMonth = new DateTime(today.Year, today.Month, 1);
                      // nextMonth is the first one not displayed; TODO: invent a proper name
                      
                      Donations = donationsOfThisMember
                          .Where(donation => donation.Date >= firstMonth && donation.Date < nextMonth)
                          .GroupBy(... etc
                      
                      class MonthlyDonation
                      {
                          public DateTime Month {get; set;}
                          public decimal Total {get; set;}
                      }
                      
                      class MemberWithMonthlyDonations
                      {
                          public string Name {get; set;}
                          ... // other Member properties that you want
                      
                          List<MonthlyDonation> Donations {get; set;}
                      }
                      
                      public static IEnumerable<MonthlyDonation> AddEmptyDonations(
                          this IEnumerable<MonthlyDonation> source,
                          DateTime firstMonth,
                          DateTime nextMonth)
                      {
                          // todo: check source not null
                          var monthlyDonations = source.ToDictionary(donation => donation.Month);
                          DateTime month = firstMonth
                          while (month < nextMonth)
                          {
                              if (monthlyDonations.TryGetValue(month, out MonthlyDonation donation))
                              {
                                  // a Donation from the database
                                  yield return donation;
                              }
                              else
                              {
                                  // this month no donation in the database
                                  yield return new MonthlyDonation
                                  {
                                      Month = month,
                                      Total = 0.0M,
                                  };
                              }
                              month = month.AddMonths(+1);
                         }
                      }
                      
                      IEnumerable<MemberWithMonthlyDonations> fetchedFromDatabase = ...
                      
                      IEnumerable<MemeberWithMonthlyDonations> result = fetchedFromDataBase
                          .AddEmptyDonations(firstMonth, nextMonth);
                      

                      How do I calculate percentages from two tables in Django

                      copy iconCopydownload iconDownload
                      @property
                      def percent_raised(self):
                      
                          total = 0.0
                          for donation in self.donation_set.all():
                              total += float( donation.raised)
                      
                          return total / float( self.target_donation) * 100.0
                      

                      Trouble attaching exported Excel file to a sendGrid email in Google Apps Script

                      copy iconCopydownload iconDownload
                      "attachment": [{"content": attachments, "type": "text/plain" , "filename": "testExcel.xlsx"}]
                      
                      "attachments": [{"content": attachments, "type": "text/plain" , "filename": "testExcel.xlsx"}]
                      
                      "attachment": [{"content": attachments, "type": "text/plain" , "filename": "testExcel.xlsx"}]
                      
                      "attachments": [{"content": attachments, "type": "text/plain" , "filename": "testExcel.xlsx"}]
                      

                      CSS. Animation with scale ends up ruining stacking context

                      copy iconCopydownload iconDownload
                          nav {
                            height: 100px;
                            position: fixed;
                            width: 100%;
                            z-index: 2; /* add this */
                          }
                      

                      Community Discussions

                      Trending Discussions on donations
                      • ModuleNotFoundError makes no sense
                      • Requests object not filtering correctly
                      • When I run nest.js, I get a Missing &quot;driver&quot; option error
                      • web3 JS payment button for Metamask BSC bep20 token
                      • Do you need to create a web service to be able to support payments/donations via Apple Pay in a React Native app?
                      • Issue with preparing dataset for use with ggalluvial and creating alluvial diagram
                      • Handling validation errors using `fluent-json-schema` in Fastify
                      • Regex not matching in Fastify route
                      • How do I include multiple entities in one row in Linq?
                      • How do I calculate percentages from two tables in Django
                      Trending Discussions on donations

                      QUESTION

                      ModuleNotFoundError makes no sense

                      Asked 2022-Apr-09 at 09:56

                      I am working on a little project and I don't really understand why I get the ModuleNotFoundError. I have the following directory structure:

                      project structure

                      My code imports the following:

                      import asyncio
                      
                      import socketio
                      
                      from core.databases.mongo_handler import create_donation, get_streamer
                      from core.models.donations import Donation
                      

                      When I try to execute the code from the command line I get the following error:

                      (venv) user@host % python standalone/sockets.py 
                      Traceback (most recent call last):
                        File "/Users/user/Project/standalone/sockets.py", line 5, in <module>
                          from core.databases.mongo_handler import create_donation, get_streamer
                      ModuleNotFoundError: No module named 'core'
                      

                      I do not understand why I get that error.

                      Sone clarifications:

                      • I do not have __init__.py files in the different directories but it doesn't change anything with them, I have tried it.
                      • I want to run the code from the root of the project which is why I run it with python standalone/sockets.py

                      ANSWER

                      Answered 2022-Apr-07 at 17:20

                      [SOLVED]

                      Thanks to S3DEV and his link I found the answer.

                      Due to the fact that I was running my file as a script and not a module, I cannot import modules in a relative way. To solve this issue and keep my directory structure I need to run the script as follows:

                      python -m standalone.sockets
                      

                      Now I ask python to consider this as a module and everything works perfectly fine. Hope this helps other people too !

                      Source https://stackoverflow.com/questions/71785686

                      Community Discussions, Code Snippets contain sources that include Stack Exchange Network

                      Vulnerabilities

                      The nd-donations plugin before 1.4 for WordPress has a nopriv_ AJAX action that allows modification of the siteurl setting.

                      Install donations

                      Keep in mind that Google forbits other payment methods besides Google Play. Thus, in the example, two build flavors are used. Check out ExampleApp/build.gradle. The build script adds DONATIONS_GOOGLE to the auto generated BuildConfig.java.
                      Add <uses-permission android:name="android.permission.INTERNET" /> to product flavors that use Flattr
                      Add <uses-permission android:name="com.android.vending.BILLING" /> to product flavors that use Google Play In-app billing
                      Have Android SDK "tools", "platform-tools", and "build-tools" directories in your PATH (http://developer.android.com/sdk/index.html)
                      Export ANDROID_HOME pointing to your Android SDK
                      Download Android Support Repository, and Google Repository using Android SDK Manager
                      Execute ./gradlew build

                      Support

                      Fork Android Donations Lib and do a pull request. I will merge your changes back into the main project.

                      DOWNLOAD this Library from

                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                      over 430 million Knowledge Items
                      Find more libraries
                      Reuse Solution Kits and Libraries Curated by Popular Use Cases
                      Explore Kits

                      Save this library and start creating your kit

                      Explore Related Topics

                      Share this Page

                      share link
                      Reuse Pre-built Kits with donations
                      Consider Popular Cryptocurrency Libraries
                      Try Top Libraries by SufficientlySecure
                      Compare Cryptocurrency Libraries with Highest Support
                      Compare Cryptocurrency Libraries with Highest Quality
                      Compare Cryptocurrency Libraries with Highest Security
                      Compare Cryptocurrency Libraries with Permissive License
                      Compare Cryptocurrency Libraries with Highest Reuse
                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                      over 430 million Knowledge Items
                      Find more libraries
                      Reuse Solution Kits and Libraries Curated by Popular Use Cases
                      Explore Kits

                      Save this library and start creating your kit

                      • © 2022 Open Weaver Inc.