Snippets Collections
{
  "eventId": 0,
  "associationId": 16,
  "eventTypeId": 2,
  "title": "International Conference on Artificial Intelligence",
  "description": "Join us for the largest gathering of AI experts and enthusiasts.",
  "cityId": 148013,
  "stateId": 32,
  "countryId": 1,
  "eventModeId": 45,
  "registrationStartDate": "2024-06-17T06:32:21.324Z",
  "registrationEndDate": "2024-06-18T06:32:21.324Z",
  "eventStartDate": "2024-06-18T06:32:21.324Z",
  "eventEndDate": "2024-06-23T06:32:21.324Z",
  "broucherUrl": "",
  "address": "Kondapur",
  "videoUrl": "https://youtube.com/shorts/t6SLjTQbPh0?si=gJ9_eiYVqS3JFsGJ",
  "eventStatusId": 0,
  "phoneCode": "+91",
  "contactNumber": "7894561235",
  "contactEmail": "info@exampleconference.com",
  "webSite": "https://exampleconference.com",
  "geolocation": {
    "x": 17.419791987251436,
    "y": 78.32488111758651
  },
  "isFreeEvent": true,
  "bannerUrls": [
    "https://conference.ebai.org/wp-content/uploads/2023/07/slide-conf23.jpg"
  ],
  "organizingGroups": [
    64
  ],
  "eventRegistrationDetails": [
    {
      "eventRegistrationDetailId": 0,
      "eventId": 0,
      "isFoodProvided": true,
      "isAccommodationProvided": true,
      "isTransportProvided": true,
      "title": "Full Conference Pass",
      "applicableTillDate": "2024-06-18T06:32:21.324Z",
      "applicableRegistrationFee": 5000,
      "applicableCurrencyCode": "INR",
      "onspotCurrencyCode": "INR",
      "onSpotRegistrationFee": 2500,
      "registeredMembers": 0
    }
  ],
  "agenda": [
    {
      "eventAgendaId": 0,
      "eventId": 0,
      "title": "Keynote Address: Future Trends in AI",
     "description": "A look into the future of artificial intelligence and its impact on society.",
     "agendaDate": "2024-06-01T12:42:32.972Z",
     "startTime": "10:00:00",
     "endTime": "16:00:00",
     "presenters": [
    267,160
   ],
 "presentersDetails": ""
 }
  ],
  "eventGuidelines": {
    "eventGuidelineId": 0,
    "eventId": 0,
    "registrationGuidelines": "Participants are encouraged to pre-register for the event",
    "cancellationGuidelines": "Clearly communicate the reason for the cancellation",
    "importantGuidelines": "Prioritize the safety and wellbeing of attendees"
  },
  "eventAccountInfo": {
    "eventAccountInfoId": 0,
    "eventId": 0,
    "name": "Conference Organizing Committee",
    "bankName": "Canara Bank",
    "bankAccountNumber": "85986263456",
    "bankRoutingTypeId": 46,
    "bankRoutingType": "IFSC",
    "bankRoutingCode": "Canara123456",
    "isOrgAccount": true
  },
  "hasRegistered": true,
  "bannerUrlsString": "string",
  "eventType": "Workshop",
  "eventMode": "Hybrid"
}
<ion-header>
  <ion-toolbar color="primary">
    <ion-title>Items in Cart</ion-title>
    <ion-buttons slot="end">
      <ion-button fill="clear">
        <ion-icon name="power-outline" color="white" slot="icon-only"></ion-icon>
      </ion-button>
    </ion-buttons>
  </ion-toolbar>
</ion-header>

<ion-content class="ion-margin">
  <ion-grid class="ion-margin">
    <ion-row>
      <ion-col><b>Subscription</b></ion-col>
      <ion-col><b>Price</b></ion-col>
      <ion-col><b>Quantity</b></ion-col>
      <ion-col><b>Total Cost</b></ion-col>
    </ion-row>

    <ion-row *ngFor="let cartSub of subscriptionsInCart">
      <ion-col>{{cartSub.subscription.name}}</ion-col>
      <ion-col>R{{cartSub.subscription.price}}</ion-col>
      <ion-col>{{cartSub.quantity}}</ion-col>
      
      <ion-icon name="caret-back-outline" (click)="reduceProdCount(cartSub.subscription)"></ion-icon>
      <ion-icon name="caret-forward-outline" (click)="increaseProdCount(cartSub.subscription)"></ion-icon>
      <ion-col>{{cartSub.totalCost}}</ion-col>

    </ion-row>
  </ion-grid>

  <ion-col size="6">
    <ion-button fill="outline" expand="block" color="primary"><b>Total: R{{totalCostOfSubcriptionsInCart}}</b></ion-button>    
  </ion-col>

  <ion-col size="6">
    <ion-button expand="block" (click)="setOpen(true)">Checkout</ion-button>
    <ion-modal [isOpen]="isModalOpen">
      <ng-template>
        <ion-header>
          <ion-toolbar>
            <ion-title></ion-title>
            <ion-buttons slot="end">
              <ion-button (click)="setOpen(false)">Close</ion-button>
            </ion-buttons>
          </ion-toolbar>
        </ion-header>
        
        <ion-content class="ion-padding">
          <p>
            Payment Successful
          </p>
        </ion-content>
      </ng-template>
    </ion-modal> 
  </ion-col>
</ion-content>

//Additional code
//TS
import { Component, OnInit } from '@angular/core';

import { CartSubScription } from '../Model/cartSubscription';
import { Subscription } from '../Model/subscriptionModel';
import { SubscriptionCartOrganiserService } from '../../services/SubscriptionCartOrganiserService';

@Component({
  selector: 'app-cart',
  templateUrl: './cart.page.html',
  styleUrls: ['./cart.page.scss'],
})
export class CartPage implements OnInit {
  subscriptionsInCart : CartSubScription [] = [];
  totalCostOfSubcriptionsInCart :number = 0;
  isModalOpen = false;
  constructor(private cartManager : SubscriptionCartOrganiserService) {
    this.loadSubscriptions();
    cartManager.cartProductsNumberDS.subscribe(num => {
        this.loadSubscriptions();
    });
  }
  
  ngOnInit(): void {
  }
  setOpen(isOpen: boolean) {
    this.isModalOpen = isOpen;
  }

  loadSubscriptions() {
    this.subscriptionsInCart = this.cartManager.getSubscriptionsInCart();
    this.totalCostOfSubcriptionsInCart = this.cartManager.getTotalCostOfSubcriptionsInCart();
  }

  increaseProdCount (sub : Subscription) {
    for (var idx = 0; idx < this.subscriptionsInCart.length; idx++) {
      if (this.subscriptionsInCart[idx].subscription.id == sub.id) {
        this.cartManager.addProdFromCart(this.subscriptionsInCart[idx].subscription);
      }
    }
  }

  reduceProdCount (sub : Subscription) {
    for (var idx = 0; idx < this.subscriptionsInCart.length; idx++) {
      if (this.subscriptionsInCart[idx].subscription.id == sub.id) {
         this.cartManager.removeProdFromCart(this.subscriptionsInCart[idx].subscription);
      }
    }
  }
}
<ion-header>
  <ion-toolbar color="primary">
    <ion-title>Streaming Providers</ion-title>
  </ion-toolbar>
</ion-header>

<ion-content>
  <ion-list>    
    <div class="card m-3" style="width: 20rem;" *ngFor="let prod of products"> 
      <ion-card>
        <ion-card-header>
          <ion-card-title> {{prod.name}} </ion-card-title>
        </ion-card-header>

        <ion-card-content> {{prod.description}} </ion-card-content>            
                  
        <ion-button (click)="addSubscriptionToCart(prod)">Add to cart</ion-button>
        
      </ion-card>      
    </div>      
  </ion-list>
</ion-content>


//Additional Code
//TS
import { Component, OnInit } from '@angular/core';

import { Subscription } from '../Model/subscriptionModel';
import { FakeSubscriptionDataService } from '../../services/FakeSubscriptionDataService';
import { SubscriptionCartOrganiserService } from '../../services/SubscriptionCartOrganiserService';
import { InfiniteScrollCustomEvent } from '@ionic/angular';

@Component({
  selector: 'app-home',
  templateUrl: './home.page.html',
  styleUrls: ['./home.page.scss'],
})
export class HomePage implements OnInit {
  products : Subscription[] | undefined;
  items = [];
  constructor(private fakeDataProvider : FakeSubscriptionDataService, private cartSubscriptionService : SubscriptionCartOrganiserService) {
    this.products = fakeDataProvider.getOfferedSubscriptions();
  }
  ngOnInit() {}

addSubscriptionToCart(product : Subscription) {
  this.cartSubscriptionService.addProdFromCart(product);
}
}
//tabs page html
<ion-tabs>
    <ion-tab-bar slot="bottom">
        <ion-tab-button tab="home">
            <ion-icon name="home-outline"></ion-icon>
            <ion-label>Home</ion-label>
        </ion-tab-button>
        <ion-tab-button tab="cart">
            <ion-fab>{{numCartItems}}</ion-fab>
                <ion-icon name="cart-outline"></ion-icon>
            <ion-label>Cart</ion-label>
        </ion-tab-button>        
    </ion-tab-bar>
</ion-tabs>

//tabs routing module ts
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { TabsPage } from './tabs.page';

const routes: Routes = [
  {
    path: 'tabs',
    component: TabsPage,
    children:[
      {
        path: 'home',
        loadChildren: () => import('./home/home.module').then(m=> m.HomePageModule)
      },
      {
        path: 'cart',
        loadChildren: () => import('./cart/cart.module').then( m => m.CartPageModule)
      }
    ]
  },
  {
    path: '',
    redirectTo: '/tabs/home',
    pathMatch: 'full'
  },
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class TabsPageRoutingModule {}


//Additional code
//tabs page ts
import { Component, OnInit } from '@angular/core';
import { SubscriptionCartOrganiserService } from '../services/SubscriptionCartOrganiserService';

@Component({
  selector: 'app-tabs',
  templateUrl: './tabs.page.html',
  styleUrls: ['./tabs.page.scss'],
})
export class TabsPage implements OnInit {

  numCartItems : number = 0;
  constructor(private cartManager : SubscriptionCartOrganiserService) {
    this.numCartItems = cartManager.getNumberOfItemsInCart();
    
    cartManager.cartProductsNumberDS.subscribe(num => {
      this.numCartItems = num;
    });
   }

  ngOnInit() {
  }
}
int main() {
   /* printf() function to write Hello, World! */
   printf( "Hello, World!" );
}
int main() {
   /* printf() function to write Hello, World! */
   printf( "Hello, World!" );
}
//TS
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import { Chart, registerables } from 'chart.js';
import { RegionModel } from '../Models/regionModel';
import { RegionService } from '../service/region.service';


Chart.register(...registerables);

@Component({
  selector: 'app-charts',
  standalone: true,
  imports: [],
  templateUrl: './charts.component.html',
  styleUrl: './charts.component.scss'
})
export class ChartsComponent implements OnInit{
  data: any;
  @ViewChild('myTemp')
  myTempRef!: ElementRef;

 
  constructor(private regionService : RegionService) {}
  
  ngOnInit(): void {
    this.regionService.getRegions().subscribe(response => {
      let regionList = response;

      this.data = response.$values;
      
      this.populateChartData(this.data);
      console.log('data',regionList)
      return regionList
    });
  }

  populateChartData(data: RegionModel[]) {
    
    let labelsData: string [] = [];
    let labelsPopulation: number [] = [];
    
    data.forEach((element: any) => {
      labelsData.push(element.code);
      labelsPopulation.push(element.population)
    });


    new Chart("barchart", {
      type: 'bar',
      data: {
        labels: labelsData,
        datasets: [{
          label: '# of Population',
          data: labelsPopulation,
          borderWidth: 1
        }]
      },
      
      options: {
        scales: {
          y: {
            beginAtZero: true
          },
        }
      
      }
    });
    

    new Chart("piechart", {
      type: 'pie',
      data: {
        labels: labelsData,
        datasets: [{
          label: '# of Population',
          data: labelsPopulation,
          borderWidth: 1
        }]
      },
      options: {
        scales: {
          y: {
            beginAtZero: true
          }
        }
      }
    });

    new Chart("dochart", {
      type: 'doughnut',
      data: {
        labels: labelsData,
        datasets: [{
          label: '# of Population',
          data: labelsPopulation,
          borderWidth: 1
        }]
      },
      options: {
        scales: {
          y: {
            beginAtZero: true
          }
        }
      }
    });

    new Chart("pochart", {
      type: 'polarArea',
      data: {
        labels: labelsData,
        datasets: [{
          label: '# of Population',
          data: labelsPopulation,
          borderWidth: 1
        }]
      },
      options: {
        scales: {
          y: {
            beginAtZero: true
          }
        }
      }
    });

    new Chart("rochart", {
      type: 'radar',
      data: {
        labels: labelsData,
        datasets: [{
          label: '# of Population',
          data: labelsPopulation,
          borderWidth: 1
        }]
      },
      options: {
        scales: {
          y: {
            beginAtZero: true
          }
        }
      }
    });

    new Chart("linechart", {
      type: 'line',
      data: {
        labels: labelsData,
        datasets: [{
          label: '# of Population',
          data: labelsPopulation,
          borderWidth: 1
          
        }]
        
      },
      options: {
        scales: {
          y: {
            beginAtZero: true
          }
        }
      }
    });

    new Chart("bubchart", {
      type: 'bubble',
      data: {
        labels: labelsData,
        datasets: [{
          label: '# of Population',
          data: labelsPopulation,
          borderWidth: 1
          
        }]
        
      },
      options: {
        scales: {
          y: {
            beginAtZero: true
          }
        }
      }
    });

  }

}
//HTML
<div class="row">
    <div class="col-lg-6">
        <h2>Line Chart</h2>
        <canvas id="linechart"></canvas>
    </div>
    <div class="col-lg-6">
        <h2>Bar Chart</h2>
        <canvas id="barchart"></canvas>
    
    </div>
    <div class="col-lg-6">
        <h2>Pie Chart</h2>
        <canvas id="piechart"></canvas>
        
    </div>
    <div class="col-lg-6">
        <h2>Doughnut Chart</h2>
        <canvas id="dochart"></canvas>
    </div>
    <div class="col-lg-6">
        <h2>polarArea Chart</h2>
        <canvas id="pochart"></canvas>
    </div>

    <div class="col-lg-6">
        <h2>Radar Chart</h2>
        <canvas id="rochart"></canvas>
    </div>
</div>
from human_readable.files import file_size
import os

print(file_size(value = os.stat('test.txt').st_size))
{
  "associationAccountInfoId": 0,
  "associationId": 16,
  "name": "",
  "bankName": "",
  "bankAccountNumber": "",
  "bankRoutingTypeId": 0,
  "bankRoutingCode": "",
  "upiId": "Helpageindia@IndianBank",
  "bankingPaymentTypeId": 171,
  "isDefault": true,
  "kycTypeId": 115,
  "kycType": "PANU",
  "kycDocumentUrl": "https://s3.ap-south-1.amazonaws.com/myassociation-dev-objects/Kyc Document2/drylab.pdf",
  "kycVerificationStatusId": 131,
  "kycVerificationStatus": "Accepted"
}
<div class="container-fluid">
			<div class="progress" style="height: 30px;">
				<div class="progress-bar bg-secondary" role="progressbar" style="width: 95%; height: 30px;">95%</div>
			</div>
			<div class="progress mt-4" style="height: 30px;">
				<div class="progress-bar bg-secondary" role="progressbar" style="width: 85%; height: 30px;">85%</div>
			</div>
			<div class="progress mt-4" style="height: 30px;">
				<div class="progress-bar bg-secondary" role="progressbar" style="width: 80%; height: 30px;">80%</div>
			</div>
			<button class="mt-3"><i class="fa-solid fa-download"></i> Download Resume</button>
		</div>
		<div class="container">
			<h5 class="mt-5">How much I charge</h5>
		</div>
public class GenericApp {

    public static void main(String[] args) {
        
        MyGeneric<String> single = new MyGeneric<>("Ichwan");
        generate(single);

    }

    public static void generate(MyGeneric<? extends Object> data){
        System.out.println(data.getData());
    }
}
ArrayList<Number> numbers = new ArrayList<Number>();
// Ini akan menghasilkan kesalahan kompilasi
ArrayList<Integer> integers = numbers;
def divide(a, b):
    assert b != 0
    print(f"{a} / {b} = {a/ b}")

divide(10, 2)
divide(10, 0)
#the break statement, causes the loop to immediately terminate.

seq = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

for i in seq:
    #define the condition
    if i == 5:
        break
    print(i)

print('after the loop')
#import the random module
import random

#The sequence to choose from
L = ['Python', 'Javascript', 'Ruby', 'Java', 'PHP', 'C++', 'C#', 'HTML', 'CSS']

#Choose random items from the list
print(random.choices(L, k = 3))
class Person:
    def __init__(self, name, age):
       self.name = name
       self.age = age

class Student(Person):
     def __init__(self, name, age, school):
        super().__init__(name, age)
        self.school = school

#Check whethe a class is a  subclass of another
print(issubclass(Student, Person))
#an exception to be raised by an empty stack
class EmptyStack(Exception):
    pass

class Stack:
    
    def __init__(self):
        self._items = [] #non-public list for storing stack elements

    def __len__(self):
        return len(self._items)

    def isEmpty(self):
        return len(self) == 0 

    def push(self, e):
        self._items.append(e) #add the element at the end of the list

    def top(self):
        if self.isEmpty():
            raise EmptyStack("Stack Is Empty.")
        return self._items[-1] #Return the last element in list

    def pop(self):
        if self.isEmpty():
            raise EmptyStack("Stack Is Empty.")
        return self._items.pop() #pop the last item from the list

# test the stack
S = Stack()

S.push("A")
S.push("B")
S.push("C")
print(S.pop())
print(S.pop())
print(S.pop())
print(S.pop())
#merge sort

#the merge algorithm
def merge(L1, L2, L):
  i = 0
  j = 0
  while i+j < len(L):
    if j == len(L2) or (i < len(L1) and L1[i] < L2[j]):
       L[i+j] = L1[i]
       i += 1
    else:
       L[i+j] = L2[j]
       j += 1

#main function
def merge_sort(L):

  n = len(L)
  if n < 2:
     return # list is already sorted

  # divide
  mid = n // 2 #midpoint
  L1 = L[0:mid] # the first half
  L2 = L[mid:n] # the second half
 
  # conquer with recursion
  merge_sort(L1) # sort first sub-list
  merge_sort(L2) # sort second sub-list

  # merge result
  merge(L1, L2, L) 

#example
L = [7, 5, 1, 4, 2, 8, 0, 9, 3, 6]
print('Before: ', L)
merge_sort(L)
print('After: ', L)
def insertion_sort(lst):
   for i in range(1, len(lst)):
      j = i
      while (j > 0) and lst[j-1] > lst[j]:
         lst[j-1], lst[j] = lst[j], lst[j-1] #swap the elements
         j -=1

#sort a list
L = [5, 2, 9, 3, 6, 1, 0, 7, 4, 8]
insertion_sort(L)
print("The sorted list is: ", L)
#descending selection sort
def selection_sort(lst):
  for i in range(len(lst)):
    smallest = i

    for j in range(i + 1, len(lst)):
      if lst[j] > lst[smallest]:
        smallest = j

    lst[i], lst[smallest] = lst[smallest], lst[i] #swap the elements

#sort a list
L = [99, 9, 0, 2, 1, 0, 1, 100, -2, 8, 7, 4, 3, 2]
selection_sort(L)

print("The sorted list is: ", L)
def selection_sort(lst):
  for i in range(len(lst)):
    smallest = i

    for j in range(i + 1, len(lst)):
      if lst[j] < lst[smallest]:
        smallest = j

    lst[i], lst[smallest] = lst[smallest], lst[i] #swap the elements

#sort a list
L = [99, 9, 0, 2, 1, 0, 1, 100, -2, 8, 7, 4, 3, 2]
selection_sort(L)

print("The sorted list is: ", L)
#Optimized bubble sort
def bubble_sort(lst):

  swapped = True
  while swapped == True:
    swapped = False
    for j in range(len(lst)-1):  
      
      if(lst[j]>lst[j+1]):
        lst[j], lst[j + 1] = lst[j + 1], lst[j] #swap the elements
        swapped = True

#sort a list
L = [9, 0, 2, 1, 0, 1, 100, -2, 8, 7, 4, 3, 2]

bubble_sort(L)  
print("The sorted list is: ", L)
#import the random module
import random

#The list to shuffle
my_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

#shuffle the list in-place
random.shuffle(my_list)

print(my_list)
#import the random module
import random

#The sequence to sample
my_seq = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

#get a sample of 4 elements
print(random.sample(my_seq, 4))
myset = {1, 3, 5, 7, 9, 11}

#remove an arbitrary element
print(myset.pop())
print(myset.pop())
print(myset.pop())
print(myset.pop())

print(myset)
#raises a KeyError if the element does not exist

myset = {0, 2, 3, 4, 6, 7, 8, 9}
myset.remove(3)
myset.remove(7)
myset.remove(9)

print(myset)
#unlike set.remove(), If the target element does not exist, set.discard method does not raise a KeyError, it returns None instead.

myset = {1, 3, 4, 5, 7, 8, 9}

#remove elements
myset.discard(4)
myset.discard(8)

print(myset)
myset = {'Python', 'Java', 'C++'}

#add elements to the set
myset.add('PHP')
myset.add('HTML')
myset.add('Javascript')

print(myset)
import functools

def power(a, b):
    return a ** b

square = functools.partial(power, b = 2)
cube = functools.partial(power, b = 3)

print(square(5))
print(cube(5))
#finally block always gets executed
#else block is only executed if no exception was raised

import math

try:
   print("Hello, World!")
   print(10/ 5)
   print(math.sqrt(-9))

except ValueError:
   print("a ValueError has occurred")

except IndexError:
    print("IndexError has occurred")

else:
    print("No Exception was raised.")
finally:
    print("This block always gets executed")
#The else block only gets executed if the try block terminates successfully i.e  no exception was raised inside the block.


import math

try:
   print("Hello, World!")
   print(10/ 2)
   print(math.sqrt(9))

except ValueError:
   print("a valu error has occurred")

except IndexError:
    print("IndexError has occurred")

else:
    print("No Exception was raised.")
import math

try:
   
   #This will raise a TypeError
   print( 3 + 'hello' )

   #This will raise a ValueError
   math.sqrt(-16)

   #This will raise a NameError
   print(a)
   
   #This will raise a zeroDivisionError
   print(10 / 0)

except NameError:
    print("A NameError occurred")

except ValueError: 
    print("A ValueError occurred")

except ZeroDivisionError:
    print("A ZeroDivisionError occurred")

except TypeError:
    print("A TypeError occurred")
try:
   
    print(1 / 0)

except ZeroDivisionError:
    print("You divided a number by 0.")
#import the ChainMap class
from collections import ChainMap

d1 = {'one': 1, 'two': 2, 'three': 3}
d2 = {'four': 4, 'five': 5, 'six': 6}
d3 = {'seven': 7, 'eight': 8, 'nine': 9}

chain = ChainMap(d1, d2, d3)

print(chain)
#a list of strings
languages = ['Python', 'Java']

#append an element
languages.append('PHP')
print(languages)

languages.append('C++')
print(languages)

languages.append('Javascript')
print(languages)
def add(a, b):
    print(f'{a} + {b} = {a + b}')

a = 10
b = 20
add(a, b)
#itertools.count()- creates an iterator which yields infinite sequence of integers from a starting point 

from itertools import count

seq = count(0, 2) #an infinite sequence of even numbers

print(next(seq))
print(next(seq))
print(next(seq))
print(next(seq))
print(next(seq))
#itertools.product() Generates the cartesian product of two iterables 

from itertools import product

data1 = [1, 2]
data2 = [10, 20]

result = product(data1, data2)

L = list(result) #turn the iterator into a list
print(L)
data = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

def is_odd(num):
   return num % 2 == 1

odds = filter(is_odd, data)

print(*odds)
from itertools import repeat

#repeat a string 10 times
r = repeat('Spam', 10)
print(r)

for i in r:
    print(i)
SELECT SubscriberKey, EmailAddress, System_Language__c, Mailing_Country__c, First_Name__c, Cat_Campaign_Most_Recent__c, Business_Unit__c, System_Opt_in_for_eMail__c, DateAdded, PCCReg
FROM (
SELECT
DISTINCT i.SubscriberKey
	,i.EmailAddress
	,i.System_Language__c
	,i.Mailing_Country__c
	,i.First_Name__c
	,i.Cat_Campaign_Most_Recent__c
	,i.Business_Unit__c
	,i.System_Opt_in_for_eMail__c
	,i.DateAdded
	,i.PCCReg,
 
ROW_NUMBER() OVER(PARTITION BY c.ID ORDER BY inta.LastModifiedDate DESC) as RowNum
 
FROM ent.Interaction__c_Salesforce inta
JOIN ent.Contact_Salesforce_1 c ON LOWER(c.Email) = LOWER(inta.Email__c)
JOIN [Proposed_Retail_TA_News_2024_INCLUDE] i ON LOWER(inta.Email__c) = LOWER(i.EmailAddress)
LEFT JOIN ps_an_en_us_s190010_Retail_TA_Segment_sendable_2021 mst ON LOWER(inta.Email__c) = LOWER(mst.EmailAddress)
WHERE 1 = 1
    AND i.SYSTEM_OPT_IN_FOR_EMAIL__C = '1'
    AND NOT EXISTS (
        SELECT NULL
        FROM [Proposed_Retail_TA_News_2024_EXCLUDE] ex
        WHERE 1 = 1
            AND i.SubscriberKey = ex.SubscriberKey
    ))t2
 
WHERE RowNum = 1
RenameColumns = Table.TransformColumnNames("Removed Other Columns", each Text.Proper(Text.Replace(Text.Replace(_, "crb3f_", ""), "_", " ")))
//TS
import { Component } from '@angular/core';
import { Chart } from 'chart.js';
@Component({
  selector: 'app-bar-line',
  templateUrl: './bar-line.component.html',
  styleUrls: ['./bar-line.component.scss']
})
export class BarLineComponent {
  ngOnInit(): void {
    this.createChart();
  }
  public chart: any;
  createChart(){
    this.chart = new Chart("bar-line", {
      type: 'line',
      data: {
        labels: ['Shirt', 'Jacket', 'Men Tops', 'Men Pants', 
                 'Swimwear', 'Shoes', 'Sleepwear', 'Men Accessories'],
        datasets:[
          {
            label:"2022",
            data: ['446','551','462','158','171','553','566','231']
          },
          {
            type:'bar',
            label:"2023",
            data: ['623','431','525','306','100','369','417','420']
          }
        ]
      }
    });
  }
}
//HTML
<div class="chart-container">
    <h2>Product Sales</h2>
    <canvas id="bar-line">{{ chart }}</canvas>
</div>
//TS
import { Component } from '@angular/core';
import {Chart, ChartDataset, ChartType} from 'chart.js';

@Component({
  selector: 'app-pie-chart',
  templateUrl: './pie-chart.component.html',
  styleUrls: ['./pie-chart.component.scss']
})
export class PieChartComponent {
  ngOnInit(): void {
    this.createChart();
  }
  public chart: any;
  createChart(){
    this.chart = new Chart("pie-chart", {
      type: 'pie',
      data: {
        labels: ['Shirt', 'Jacket', 'Men Tops', 'Men Pants', 
                 'Swimwear', 'Shoes', 'Sleepwear', 'Men Accessories'],
        datasets:[
          {
            label:"2022",
            data: ['446','551','462','158','171','553','566','231']
          },
          {
            label:"2023",
            data: ['623','431','525','306','100','369','417','420']
          }
        ]
      }
    });
  }
}
//HTML
<div class="chart-container">
    <h2>Product Sales</h2>
    <canvas id="pie-chart">{{ chart }}</canvas>
</div>
star

Tue Jun 18 2024 08:43:58 GMT+0000 (Coordinated Universal Time)

@Ranjith

star

Tue Jun 18 2024 08:25:34 GMT+0000 (Coordinated Universal Time)

@iamkatmakhafola

star

Tue Jun 18 2024 07:59:19 GMT+0000 (Coordinated Universal Time)

@iamkatmakhafola

star

Tue Jun 18 2024 07:51:05 GMT+0000 (Coordinated Universal Time)

@iamkatmakhafola

star

Tue Jun 18 2024 07:47:09 GMT+0000 (Coordinated Universal Time)

@AbCaulder03 #c#

star

Tue Jun 18 2024 07:47:09 GMT+0000 (Coordinated Universal Time)

@AbCaulder03 #c#

star

Tue Jun 18 2024 07:09:34 GMT+0000 (Coordinated Universal Time)

@iamkatmakhafola

star

Tue Jun 18 2024 06:16:28 GMT+0000 (Coordinated Universal Time)

@Ranjith

star

Tue Jun 18 2024 05:42:37 GMT+0000 (Coordinated Universal Time)

@ravinyse

star

Tue Jun 18 2024 05:20:30 GMT+0000 (Coordinated Universal Time) https://ichwansholihin.medium.com/mengenal-konsep-invariant-covariant-dan-contravariant-pada-generic-type-parameter-di-java-9998d0911d52

@iyan #java

star

Tue Jun 18 2024 05:12:09 GMT+0000 (Coordinated Universal Time) https://ichwansholihin.medium.com/mengenal-konsep-invariant-covariant-dan-contravariant-pada-generic-type-parameter-di-java-9998d0911d52

@iyan #java

star

Tue Jun 18 2024 04:13:23 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/assert-statement-in-python/

@pynerds #python

star

Tue Jun 18 2024 04:11:28 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/break-and-continue-statements-in-python/

@pynerds #python

star

Tue Jun 18 2024 03:28:36 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/python-random-choices-function/

@pynerds #python

star

Tue Jun 18 2024 03:27:39 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/python-issubclass-function/

@pynerds

star

Tue Jun 18 2024 03:26:20 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/data-structures/implement-stack-data-structure-in-python/

@pynerds #python

star

Tue Jun 18 2024 03:24:52 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/data-structures/implement-merge-sort-in-python/

@pynerds #python

star

Tue Jun 18 2024 03:23:53 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/data-structures/implement-insertion-sort-in-python/

@pynerds #python

star

Tue Jun 18 2024 03:23:20 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/data-structures/implement-selection-sort-in-python/

@pynerds #python

star

Tue Jun 18 2024 03:22:36 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/data-structures/implement-selection-sort-in-python/

@pynerds

star

Tue Jun 18 2024 03:21:14 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/data-structures/implement-bubble-sort-algorithm-in-python/

@pynerds #python

star

Tue Jun 18 2024 03:18:11 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/python-collections-module/

@pynerds #python

star

Tue Jun 18 2024 03:13:58 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/python-collections-deque/

@pynerds #python

star

Tue Jun 18 2024 03:06:00 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/python-random-shuffle-function/

@pynerds #python

star

Tue Jun 18 2024 03:04:26 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/python-random-sample-function/

@pynerds #python

star

Tue Jun 18 2024 03:03:04 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/set-pop-method-in-python/

@pynerds #python

star

Tue Jun 18 2024 03:02:04 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/set-remove-method-in-python/

@pynerds

star

Tue Jun 18 2024 02:57:51 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/set-discard-method-in-python/

@pynerds #python

star

Tue Jun 18 2024 02:56:17 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/set-methods-in-python/

@pynerds

star

Tue Jun 18 2024 02:54:06 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/set-add-method-in-python/

@pynerds #python

star

Tue Jun 18 2024 02:53:02 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/partial-functions-in-python/

@pynerds #python

star

Tue Jun 18 2024 02:48:31 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/exception-handling-in-python/

@pynerds #python

star

Tue Jun 18 2024 02:44:46 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/exception-handling-in-python/

@pynerds #python

star

Tue Jun 18 2024 02:40:57 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/exception-handling-in-python/

@pynerds #python

star

Tue Jun 18 2024 02:37:17 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/exception-handling-in-python/

@pynerds #python

star

Tue Jun 18 2024 02:36:11 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/exception-handling-in-python/

@pynerds #python

star

Tue Jun 18 2024 02:33:06 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/compiler/

@pynerds

star

Tue Jun 18 2024 02:31:18 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/python-collections-chainmap/

@pynerds

star

Tue Jun 18 2024 02:29:03 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/python-add-items-to-a-list/

@pynerds #python

star

Tue Jun 18 2024 02:27:25 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/compiler/

@pynerds #python

star

Tue Jun 18 2024 02:25:51 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/python-itertools-count/

@pynerds #python

star

Tue Jun 18 2024 02:23:54 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/python-itertools-product/

@pynerds

star

Tue Jun 18 2024 02:12:48 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/python-itertools-filterfalse/

@pynerds #python

star

Tue Jun 18 2024 02:07:54 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/python-itertools-repeat/

@pynerds #python

star

Mon Jun 17 2024 19:30:56 GMT+0000 (Coordinated Universal Time)

@shirnunn

star

Mon Jun 17 2024 17:55:55 GMT+0000 (Coordinated Universal Time)

@bdusenberry

star

Mon Jun 17 2024 17:22:43 GMT+0000 (Coordinated Universal Time) https://www.facebook.com/checkpoint/?next

@gangaa

star

Mon Jun 17 2024 13:31:13 GMT+0000 (Coordinated Universal Time)

@iamkatmakhafola

star

Mon Jun 17 2024 13:26:04 GMT+0000 (Coordinated Universal Time)

@iamkatmakhafola

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension