Snippets Collections
# create a pipeline
select_pipe = make_pipeline(StandardScaler(), SelectPercentile(), KNeighborsClassifier())
# create the search grid.
# Pipeline hyper-parameters are specified as <step name>__<hyper-parameter name>
param_grid = {'kneighborsclassifier__n_neighbors': range(1, 10),
              'selectpercentile__percentile': [1, 2, 5, 10, 50, 100]}
# Instantiate grid-search
grid = GridSearchCV(select_pipe, param_grid, cv=10)
# run the grid-search and report results
grid.fit(X_train, y_train)
print(grid.best_params_)
print(grid.score(X_test, y_test))
# GOOD!
scores = []
select = SelectPercentile(percentile=5)
for train, test in KFold().split(X, y):
    select.fit(X[train], y[train])
    X_sel_train = select.transform(X[train])
    knn = KNeighborsClassifier().fit(X_sel_train, y[train])
    X_sel_test = select.transform(X[test])
    score = knn.score(X_sel_test, y[test])
    scores.append(score)
int i=1;
int NoOfStars=1;
int NoOfSpace=6;
int NumberOfLines=9,j,space;
while (i<=NumberOfLines){
j=1;
while (j<=NoOfStars){
if( i%2!=0)
cout<< "*"<<" ";
else
cout<< " "<<"*";
j+=1;
}
space=1;
while (space<=NoOfSpace){
cout<<" ";
space+=1;
}
if (i==(NumberOfLines/2)+1)
NoOfStars-=1;
j=1;
while (j<=NoOfStars){
if (i%2==0)
cout<<"*"<<" ";
else
cout<<" "<<"*";
j+=1;
}
if (i==(NumberOfLines/2)+1)
NoOfStars+=1;
cout<<endl;
if (i%2==0 && i<=(NumberOfLines/2)+1){
NoOfStars+=1;
NoOfSpace-=4;
}
else if (i%2!=0 && i>=(NumberOfLines/2)+1){
NoOfStars-=1;
NoOfSpace+=4;
}
i+=1;}
%%[set @firstName = AttributeValue("FirstName")
set @UNvalue= "?" 
set @firstName = ProperCase(@firstName)
if @firstName == "unknown" OR IndexOf(@firstName,@UNvalue) > 0 then set @FirstName = "" endif
if not Empty(@firstName) then set @greeting = Concat(", ", @firstName)
else
set @greeting = ""
endif ]%%
input[type="radio"] {
    margin-right: 1em;
    appearance: none;
    width: 12px;
    height: 12px;
    background-image: url("checkbox_off.gif");       
}

input[type="radio"]:checked {
    background-image: url("checkbox_on.gif");           
}
const photos = document.querySelectorAll('.photo');

function enlargeImg(element) {
    const imgElement = element.querySelector('img');
    const portfolioText = element.querySelector('.portfolio-text');

    imgElement.classList.add('enlarged');
    portfolioText.style.display = 'none';
}

function resetImg(element) {
    const imgElement = element.querySelector('img');
    const portfolioText = element.querySelector('.portfolio-text');

    imgElement.classList.remove('enlarged');
    portfolioText.style.display = 'block';
}

photos.forEach(photo => {
    photo.addEventListener('click', () => {
        enlargeImg(photo);
    });

    document.addEventListener('click', event => {
        if (!photo.contains(event.target)) {
            resetImg(photo);
        }
    });
});
Write a c program to find the second smallest element in an integer array.

#include <stdio.h>
 #include <limits.h>
 
int main() {
    
    int arr[] = {1,1,1,1,1,1};
  //int arr[] = {9,5,2,8,1};
    int size = sizeof(arr) / sizeof(arr[0]);
    int smallest = INT_MAX;
    int secondSmallest = INT_MAX;

    for (int i = 0; i < size; i++) {
        if (arr[i] < smallest) {
            secondSmallest = smallest;
            smallest = arr[i];
        } 
        else if (arr[i] < secondSmallest && arr[i] != smallest) {
            secondSmallest = arr[i];
        }
    }

    if (secondSmallest == INT_MAX) {
        printf("No second smallest element found.\n");
    } 
    else {
        printf("Second smallest element: %d\n", secondSmallest);
    }

    return 0;
}
output: No second smallest element found.
//OutPUT : Second smallest element: 2
#include <iostream>
#include<cmath>
using namespace std;

int main() {
    int k,j;
cout<<"Enter the Number"<<endl;// enter 10
cin>>k;
int z=0,i=1;
while (i <= k){
z=z+i;
i=i+1;
}
while (k >=1){
j=1;
while (j <= k){
cout<<z-k+j<<" ";
j=j+1;
}
z=z-k;
cout<<endl;
k=k-1;
}
    return 0;
}
if (a != 0) { // Išvengiame dalybos iš nulio
    double x = static_cast<double>(-b) / a;
    cout << "x = " << fixed << setprecision(2) << x << endl;
  } else {
    cout << "Tiesinė lygtis neturi vienintelio sprendinio, nes a = 0." << endl;
  }

  return 0;
}
int x = 5;
double y = static_cast<double>(x); // Konvertuojame 'x' į double tipo kintamąjį 'y'
#include <cmath>
#include <iomanip>
#include <iostream>

using namespace std;

int main() {
  double x;
  cin >> x;
  x = pow(x, 3);
  cout << x;

  return 0;
}
const animals = ["Elefant", "Krokodil", "Maus", "Schildkröte"];
animals[0]; // ist "Elefant
animals[3]; // ist "Schildkröte"
animals[2] = "Vogel"; // "Maus" wird ersetzt durch "Vogel"
const obj = {
  name: "John",
};

let x = obj.name; // x wird to "John"
obj.name = "Jane"; // obj.name wird zu "Jane"
// Definiere die Hobbys
const hobbies = ["Tauchen", "Schach"];
const deutschNoten = [5.3, 4.9, 6];
const hatGerneHunde = true;

// Erstelle den Schüler
const student = {
  name: "John",
  age: 18,
  likesDogs: hatGerneHunde, // <-- hatGerneHunde boolean von Oben
  hobbies: hobbies, // <-- hobbies Array von Oben
  noten: {
    english: [2.3, 4.8, 4.1],
    deutsch: deutschNoten, // <-- deutschNoten Array von Oben
  },
};
// Definiere die Hobbys
const hobbies = ["Tauchen", "Schach"];
const deutschNoten = [5.3, 4.9, 6];
const hatGerneHunde = true;

// Erstelle den Schüler
const student = {
  name: "John",
  age: 18,
  likesDogs: hatGerneHunde, // <-- hatGerneHunde boolean von Oben
  hobbies: hobbies, // <-- hobbies Array von Oben
  noten: {
    english: [2.3, 4.8, 4.1],
    deutsch: deutschNoten, // <-- deutschNoten Array von Oben
  },
};
print("Welcome to the Band Name Generator.")
street = input("What's the name of the city you grew up in?\n")
pet = input("What's your pet's name?\n")
print("Your band name could be " + street + " " + pet)
input("what is u name?")
print("Day 1 - String Manipulation")
print('String Concatenation is done with the "+" sign.')
print('e.g. print("Hello " + "world")')
print("New lines can be created with a backslash and n.")
Print("Hello World")
#include<stdio.h>
int main()
{
    int n,i;
        printf("enter a number : ");
        scanf("%d",&n);
        for(i=0;i<=10;i++){
            printf("%d * %d=%d\n",n,i,n*i);
        }
}
#include <stdio.h>

int main() {
    int n;
    for(n=19;n<=100;n=n+1){
        if (n%19==0)
        printf("%d .\n",n);
    }
}
#include <stdio.h>

int main() {
    int n;
    for(n=2;n<=100;n=n+2){
        printf("%d .\n",n);
    }
}
#include <stdio.h>

int main() {
    int n;
    for(n=0;n<=100;n++){
        printf("%d .\n",n);
    }
}
.bg{
  background-image: linear-gradient(-225deg,#3498db 0,#9b59b6 29%,#e74c3c 67%,#f1c40f 100%);
    background-size: 500% 500%;
    animation: bg 8s linear infinite;
}
<script>  
  jQuery(document).ready(function($){
$('.et_pb_more_button').addClass('fh-button-true-flat-yellow');
$('.et_pb_more_button').removeClass('et_pb_more_button et_pb_button');
  });
</script>
add_action('wp_ajax_add_product_to_cart', 'add_product_to_cart_ajax');
add_action('wp_ajax_nopriv_add_product_to_cart', 'add_product_to_cart_ajax');

function add_product_to_cart_ajax() {
    $product_id = isset($_POST['product_id']) ? intval($_POST['product_id']) : 0;
    $quantity = isset($_POST['quantity']) ? intval($_POST['quantity']) : 1;

    if ($product_id > 0) {
        WC()->cart->add_to_cart($product_id, $quantity);
        wp_send_json('Product added to cart');
    } else {
        wp_send_json('Invalid product');
    }
}

//second custom code to direct checkout.

add_filter('woocommerce_add_to_cart_redirect', 'custom_add_to_cart_redirect');

function custom_add_to_cart_redirect($url) {
    global $woocommerce;
    $checkout_url = wc_get_checkout_url();

    return $checkout_url;
}
import { Modal, ModalCustom, Tabs, Tab, Badge, useToast, Checkbox } from '@ocv-web/ui'
import {
  categoryMap,
  certaintyMap,
  weaCertaintyMap,
  eventCodes,
  eventResponseMap,
  severityMap,
  weaSeverityMap,
  urgencyMap,
  weaUrgencyMap,
  weaHandlingMap,
  NotificationFormData,
} from '../../config'
import React from 'react'
import { DetailMap } from '../DetailTabs/DetailMap'
import {
  useNotificationMutation,
  useNotificationsMutation,
} from '../../api/notifications'
import { useTemplateMutation, useTemplatesMutation } from '../../api/templates'
import { useParams } from 'react-router-dom'
import { OCVRouteParams } from '../../../core/types'
import { useUserSelection } from '../../../core/context/UserSelectionContext'
import { useUser } from '../../../administration/api/users'
export interface SubmissionModalProps {
  show: boolean
  showAction: () => void
  formData: NotificationFormData
  templateEdit: boolean
  template: boolean
  newNotification: boolean
  setSubmitStatus?: React.Dispatch<React.SetStateAction<string>>
}

const alertMapping = {
  GeoPhysical: 'Geo',
  Meteorological: 'Met',
  Safety: 'Safety',
  Security: 'Security',
  Rescue: 'Rescue',
  Fire: 'Fire',
  Health: 'Health',
  'Environmental (Env)': 'Env',
  Transport: 'Transport',
  'Infrastructure (Infra)': 'Infra',
  CBRNE: 'CBRNE',
  Other: 'Other',
}

export const SubmissionModal: React.FC<SubmissionModalProps> = ({
  show,
  showAction,
  formData,
  templateEdit,
  template,
  setSubmitStatus,
  newNotification,
}) => {
  const { id } = useParams<OCVRouteParams>()
  const [disabled, toggleDisabled] = React.useState(true)
  const { userEmail } = useUserSelection()
  const { data } = useUser(userEmail)
  const userName = data?.Results[0]?.Name
  const [selectedTab, setTabSelected] = React.useState(0)
  const [mutate] = useNotificationsMutation()
  const [mutatePatch] = useNotificationMutation(id)
  const [templateMutate] = useTemplatesMutation()
  const [mutateTemplatePatch] = useTemplateMutation(id)
  const { dispatch } = useToast()
  const handleTabChange = React.useCallback(
    newSelectedTab => setTabSelected(newSelectedTab),
    []
  )
  const localStorageData = JSON.parse(localStorage.getItem('formObject'))
  React.useEffect(() => {
    console.log(template)
  }, [template])
  const handleSend = () => {
    if (localStorageData && Object.keys(localStorageData).length > 0) {
      localStorage.setItem('formObject', JSON.stringify({}))
      window.location.reload()
    }

    if (template === true) {
      try {
        templateMutate({
          Name: formData.Title,
          Type: formData.Type,
<<<<<<< HEAD
          CreatedBy: { Name: userName, Email: userEmail },
=======
          CreatedBy: { Name: 'Rob Beaty', Email: 'rob@myocv.com' },
>>>>>>> master
          Template: {
            Title: formData.Title,
            Description: formData.Description,
            Type: formData.Type,
            Locations: JSON.parse(formData.Locations),
<<<<<<< HEAD
            SentBy: { Name: userName, Email: userEmail },
=======
            SentBy: { Name: 'Rob Beaty', Email: 'rob@myocv.com' },
>>>>>>> master
            Groups: [formData.Groups],
            IPAWSInfo: {
              DisseminationChannels: {
                EAS: formData.EAS,
                WEA: formData.WEA,
                NWEM: formData.NWEM,
              },
              Instructions: formData.Instructions,
              Severity: formData.Severity,
              Urgency: formData.Urgency,
              Certainty: formData.Certainty,
              AlertCategory: formData.AlertCategory,
              EventCode: formData.EventCode,
              EventResponse: formData.EventResponse,
              CountyFIPS: parseInt(formData.CountyFIPS),
              WEAShortText: formData.WEAShortText,
              WEALongText: formData.WEALongText,
              WEAHandling: formData.WEAHandling,
              WEASpanish: formData.WEASpanish,
              WEAShortTextSpanish: formData.WEAShortTextSpanish,
              WEALongTextSpanish: formData.WEALongTextSpanish,
              IPAWSKey: formData.IPAWSKey,
            },
            Expires: {
              Hours: formData.ExpiresInHours,
              Minutes: formData.ExpiresInMinutes,
            },
            SchedulingInfo: {
              Schedule: formData.ScheduleNotification,
              Hide: formData.ScheduleHide,
              SendDate: formData.ScheduleDate,
              HideDate: formData.ScheduleHideDate,
              Recurring: formData.ScheduleRecurring,
              Frequency: formData.Frequency,
            },
            SocialMedia: {
              Instagram: formData.Instagram,
              Facebook: formData.Facebook,
              Twitter: formData.Twitter,
            },
            FeatureToOpen: formData.FeatureToOpen,
<<<<<<< HEAD
            LastUpdated: new Date().toLocaleString(),
=======
            Response: {
              body: {
                alertId: '',
                sender: '',
                sentOn: '',
              },
            },
>>>>>>> master
          },
        })
        dispatch({
          type: 'add',
          payload: {
            title: 'Template Added Successfully.',
            status: 'success',
            message: 'You successfully added this Template.',
          },
        })
        setSubmitStatus && setSubmitStatus('success')
        showAction()
      } catch {
        dispatch({
          type: 'add',
          payload: {
            title: 'Adding Template Failed.',
            status: 'error',
            message: 'You failed to add this Template.',
          },
        })
        setSubmitStatus && setSubmitStatus('failed')
        showAction()
      }
    } else if (formData.IPAWSTemplate === true) {
      try {
        mutate({
          Title: formData.Title,
          Description: formData.Description,
          Type: formData.Type,
          Locations: JSON.parse(formData.Locations),
<<<<<<< HEAD
          SentBy: { Name: userName, Email: userEmail },
=======
          SentBy: { Name: 'Rob Beaty', Email: 'rob@myocv.com' },
>>>>>>> master
          Groups: [formData.Groups],
          IPAWSInfo: {
            DisseminationChannels: {
              EAS: formData.EAS,
              WEA: formData.WEA,
              NWEM: formData.NWEM,
            },
            Instructions: formData.Instructions,
            Severity: formData.Severity,
            Urgency: formData.Urgency,
            Certainty: formData.Certainty,
            AlertCategory: formData.AlertCategory,
            EventCode: formData.EventCode,
            EventResponse: formData.EventResponse,
            CountyFIPS: parseInt(formData.CountyFIPS),
            WEAShortText: formData.WEAShortText,
            WEALongText: formData.WEALongText,
            WEAHandling: formData.WEAHandling,
            WEASpanish: formData.WEASpanish,
            WEAShortTextSpanish: formData.WEAShortTextSpanish,
            WEALongTextSpanish: formData.WEALongTextSpanish,
            IPAWSKey: formData.IPAWSKey,
          },
          Expires: { Hours: formData.ExpiresInHours, Minutes: formData.ExpiresInMinutes },
          SchedulingInfo: {
            Schedule: formData.ScheduleNotification,
            Hide: formData.ScheduleHide,
            SendDate: formData.ScheduleDate,
            HideDate: formData.ScheduleHideDate,
            Recurring: formData.ScheduleRecurring,
            Frequency: formData.Frequency,
          },
          SocialMedia: {
            Instagram: formData.Instagram,
            Facebook: formData.Facebook,
            Twitter: formData.Twitter,
          },
          FeatureToOpen: formData.FeatureToOpen,
<<<<<<< HEAD
          LastUpdated: new Date().toLocaleString(),
=======
          Response: {
            body: {
              alertId: '',
              sender: '',
              sentOn: '',
            },
          },
>>>>>>> master
        }).then(() => {
          templateMutate({
            Name: formData.Title,
            Type: formData.Type,
<<<<<<< HEAD
            CreatedBy: { Name: userName, Email: userEmail },
=======
            CreatedBy: { Name: 'Rob Beaty', Email: 'rob@myocv.com' },
>>>>>>> master
            Template: {
              Title: formData.Title,
              Description: formData.Description,
              Type: formData.Type,
              Locations: JSON.parse(formData.Locations),
<<<<<<< HEAD
              SentBy: { Name: userName, Email: userEmail },
=======
              SentBy: { Name: 'Rob Beaty', Email: 'rob@myocv.com' },
>>>>>>> master
              Groups: [formData.Groups],
              IPAWSInfo: {
                DisseminationChannels: {
                  EAS: formData.EAS,
                  WEA: formData.WEA,
                  NWEM: formData.NWEM,
                },
                Instructions: formData.Instructions,
                Severity: formData.Severity,
                Urgency: formData.Urgency,
                Certainty: formData.Certainty,
                AlertCategory: formData.AlertCategory,
                EventCode: formData.EventCode,
                EventResponse: formData.EventResponse,
                CountyFIPS: parseInt(formData.CountyFIPS),
                WEAShortText: formData.WEAShortText,
                WEALongText: formData.WEALongText,
                WEAHandling: formData.WEAHandling,
                WEASpanish: formData.WEASpanish,
                WEAShortTextSpanish: formData.WEAShortTextSpanish,
                WEALongTextSpanish: formData.WEALongTextSpanish,
                IPAWSKey: formData.IPAWSKey,
              },
              Expires: {
                Hours: formData.ExpiresInHours,
                Minutes: formData.ExpiresInMinutes,
              },
              SchedulingInfo: {
                Schedule: formData.ScheduleNotification,
                Hide: formData.ScheduleHide,
                SendDate: formData.ScheduleDate,
                HideDate: formData.ScheduleHideDate,
                Recurring: formData.ScheduleRecurring,
                Frequency: formData.Frequency,
              },
              SocialMedia: {
                Instagram: formData.Instagram,
                Facebook: formData.Facebook,
                Twitter: formData.Twitter,
              },
              FeatureToOpen: formData.FeatureToOpen,
<<<<<<< HEAD
              LastUpdated: new Date().toLocaleString(),
=======
              Response: {
                body: {
                  alertId: '',
                  sender: '',
                  sentOn: '',
                },
              },
>>>>>>> master
            },
          })
        })

        dispatch({
          type: 'add',
          payload: {
            title: 'Notification Sent Successfully.',
            status: 'success',
            message: 'You successfully sent this MAXX Notification.',
          },
        })
        setSubmitStatus && setSubmitStatus('success')
        showAction()
      } catch {
        dispatch({
          type: 'add',
          payload: {
            title: 'Sending Notification Failed.',
            status: 'error',
            message: 'You failed to send this MAXX Notification.',
          },
        })
        setSubmitStatus && setSubmitStatus('failed')
        showAction()
      }
    } else {
      try {
        mutate({
          Title: formData.Title,
          Description: formData.Description,
          Type: formData.Type,
          Locations: JSON.parse(formData.Locations),
<<<<<<< HEAD
          SentBy: { Name: userName, Email: userEmail },
=======
          SentBy: { Name: 'Rob Beaty', Email: 'rob@myocv.com' },
>>>>>>> master
          Groups: [formData.Groups],
          IPAWSInfo: {
            DisseminationChannels: {
              EAS: formData.EAS,
              WEA: formData.WEA,
              NWEM: formData.NWEM,
            },
            Instructions: formData.Instructions,
            Severity: formData.Severity,
            Urgency: formData.Urgency,
            Certainty: formData.Certainty,
            AlertCategory: formData.AlertCategory,
            EventCode: formData.EventCode,
            EventResponse: formData.EventResponse,
            CountyFIPS: parseInt(formData.CountyFIPS),
            WEAShortText: formData.WEAShortText,
            WEALongText: formData.WEALongText,
            WEAHandling: formData.WEAHandling,
            WEASpanish: formData.WEASpanish,
            WEAShortTextSpanish: formData.WEAShortTextSpanish,
            WEALongTextSpanish: formData.WEALongTextSpanish,
            IPAWSKey: formData.IPAWSKey,
          },
          Expires: { Hours: formData.ExpiresInHours, Minutes: formData.ExpiresInMinutes },
          SchedulingInfo: {
            Schedule: formData.ScheduleNotification,
            Hide: formData.ScheduleHide,
            SendDate: formData.ScheduleDate,
            HideDate: formData.ScheduleHideDate,
            Recurring: formData.ScheduleRecurring,
            Frequency: formData.Frequency,
          },
          SocialMedia: {
            Instagram: formData.Instagram,
            Facebook: formData.Facebook,
            Twitter: formData.Twitter,
          },
          FeatureToOpen: formData.FeatureToOpen,
<<<<<<< HEAD
          LastUpdated: new Date().toLocaleString(),
=======
          Response: {
            body: {
              alertId: '',
              sender: '',
              sentOn: '',
            },
          },
>>>>>>> master
        })
        dispatch({
          type: 'add',
          payload: {
            title: 'Notification Sent Successfully.',
            status: 'success',
            message: 'You successfully sent this MAXX Notification.',
          },
        })
        setSubmitStatus && setSubmitStatus('success')
        showAction()
      } catch {
        dispatch({
          type: 'add',
          payload: {
            title: 'Sending Notification Failed.',
            status: 'error',
            message: 'You failed to send this MAXX Notification.',
          },
        })
        setSubmitStatus && setSubmitStatus('failed')
        showAction()
      }
    }
  }
  const handleNotificationUpdate = () => {
    try {
      mutatePatch({
        Title: formData.Title,
        Description: formData.Description,
        Type: formData.Type,
        Locations: JSON.parse(formData.Locations),
<<<<<<< HEAD
        SentBy: { Name: userName, Email: userEmail },
=======
        SentBy: { Name: 'Rob Beaty', Email: 'rob@myocv.com' },
>>>>>>> master
        Groups: [formData.Groups],
        IPAWSInfo: {
          DisseminationChannels: {
            EAS: formData.EAS,
            WEA: formData.WEA,
            NWEM: formData.NWEM,
          },
          Instructions: formData.Instructions,
          Severity: formData.Severity,
          Urgency: formData.Urgency,
          Certainty: formData.Certainty,
          AlertCategory: formData.AlertCategory,
          EventCode: formData.EventCode,
          EventResponse: formData.EventResponse,
          CountyFIPS: parseInt(formData.CountyFIPS),
          WEAShortText: formData.WEAShortText,
          WEALongText: formData.WEALongText,
          WEAHandling: formData.WEAHandling,
          WEASpanish: formData.WEASpanish,
          WEAShortTextSpanish: formData.WEAShortTextSpanish,
          WEALongTextSpanish: formData.WEALongTextSpanish,
          IPAWSKey: formData.IPAWSKey,
        },
        Expires: { Hours: formData.ExpiresInHours, Minutes: formData.ExpiresInMinutes },
        SchedulingInfo: {
          Schedule: formData.ScheduleNotification,
          Hide: formData.ScheduleHide,
          SendDate: formData.ScheduleDate,
          HideDate: formData.ScheduleHideDate,
          Recurring: formData.ScheduleRecurring,
          Frequency: formData.Frequency,
        },
        SocialMedia: {
          Instagram: formData.Instagram,
          Facebook: formData.Facebook,
          Twitter: formData.Twitter,
        },
        FeatureToOpen: formData.FeatureToOpen,
<<<<<<< HEAD
        LastUpdated: new Date().toLocaleString(),
=======
        Response: {
          body: {
            alertId: '',
            sender: '',
            sentOn: '',
          },
        },
>>>>>>> master
      })
      dispatch({
        type: 'add',
        payload: {
          title: 'Notification Updated Successfully.',
          status: 'success',
          message: 'You successfully updated this MAXX Notification.',
        },
      })
      showAction()
    } catch {
      dispatch({
        type: 'add',
        payload: {
          title: 'Updating Notification Failed.',
          status: 'error',
          message: 'You failed to update this MAXX Notification.',
        },
      })
      showAction()
    }
  }
  const handleTemplatePatch = () => {
    try {
      mutateTemplatePatch({
        Name: formData.Title,
        Type: formData.Type,
<<<<<<< HEAD
        CreatedBy: { Name: userName, Email: userEmail },
=======
        CreatedBy: { Name: 'Rob Beaty', Email: 'rob@myocv.com' },
>>>>>>> master
        Template: {
          Title: formData.Title,
          Description: formData.Description,
          Type: formData.Type,
          Locations: JSON.parse(formData.Locations),
<<<<<<< HEAD
          SentBy: { Name: userName, Email: userEmail },
=======
          SentBy: { Name: 'Rob Beaty', Email: 'rob@myocv.com' },
>>>>>>> master
          Groups: [formData.Groups],
          IPAWSInfo: {
            DisseminationChannels: {
              EAS: formData.EAS,
              WEA: formData.WEA,
              NWEM: formData.NWEM,
            },
            Instructions: formData.Instructions,
            Severity: formData.Severity,
            Urgency: formData.Urgency,
            Certainty: formData.Certainty,
            AlertCategory: formData.AlertCategory,
            EventCode: formData.EventCode,
            EventResponse: formData.EventResponse,
            CountyFIPS: parseInt(formData.CountyFIPS),
            WEAShortText: formData.WEAShortText,
            WEALongText: formData.WEALongText,
            WEAHandling: formData.WEAHandling,
            WEASpanish: formData.WEASpanish,
            WEAShortTextSpanish: formData.WEAShortTextSpanish,
            WEALongTextSpanish: formData.WEALongTextSpanish,
            IPAWSKey: formData.IPAWSKey,
          },
          Expires: {
            Hours: formData.ExpiresInHours,
            Minutes: formData.ExpiresInMinutes,
          },
          SchedulingInfo: {
            Schedule: formData.ScheduleNotification,
            Hide: formData.ScheduleHide,
            SendDate: formData.ScheduleDate,
            HideDate: formData.ScheduleHideDate,
            Recurring: formData.ScheduleRecurring,
            Frequency: formData.Frequency,
          },
          SocialMedia: {
            Instagram: formData.Instagram,
            Facebook: formData.Facebook,
            Twitter: formData.Twitter,
          },
          FeatureToOpen: formData.FeatureToOpen,
<<<<<<< HEAD
          LastUpdated: new Date().toLocaleString(),
=======
          Response: {
            body: {
              alertId: '',
              sender: '',
              sentOn: '',
            },
          },
>>>>>>> master
        },
      })
      showAction()
      dispatch({
        type: 'add',
        payload: {
          title: 'Template Updated Successfully.',
          status: 'success',
          message: 'You successfully updated this Template.',
        },
      })
    } catch {
      dispatch({
        type: 'add',
        payload: {
          title: 'Updating Template Failed.',
          status: 'error',
          message: 'You failed to update this Template.',
        },
      })
      showAction()
    }
  }
  const disseminationChannels = []
  if (formData.EAS) disseminationChannels.push('EAS')
  if (formData.WEA) disseminationChannels.push('WEA/CMAS')
  if (formData.NWEM) disseminationChannels.push('NWEM')
  return (
    show && (
      <Modal
        disabled={disabled}
        buttons
        width="xxl"
        buttonColor={disabled ? 'gray' : 'green'}
        show={show}
        onCancel={() => showAction()}
        onClick={
          templateEdit
            ? handleTemplatePatch
            : newNotification
            ? handleSend
            : handleNotificationUpdate
        }
        buttonTitle="Send Notification"
      >
        <ModalCustom>
          <div className="flex-1 overflow-y-hidden">
            <div className="h-full py-8 xl:py-10">
              <div className="flex flex-col px-2 mx-auto sm:px-6 lg:px-8 xl:h-full">
                <div className="xl:col-span-2 xl:pr-8">
                  {formData.IPAWSKey === 'Test' ? (
                    <div className="flex flex-col h-10 rounded-md mb-4 space-x-0 space-y-4 md:flex-row md:space-x-4 md:space-y-0 bg-green-600">
                      <p className="pl-px text-2xl">
                        IPAWS Environment: {formData.IPAWSKey} - Lab
                      </p>
                    </div>
                  ) : (
                    <div className="flex flex-col h-10 rounded-md mb-4 space-x-0 space-y-4 md:flex-row md:space-x-4 md:space-y-0 bg-red-600">
                      <p className="pl-px text-2xl">
                        IPAWS Environment: {formData.IPAWSKey} - WARNING LIVE ENVIRONMENT
                      </p>
                    </div>
                  )}
                  <h2 className="font-semibold text-gray-300 ">Headline (Title)</h2>
                  <h1 className="text-2xl font-bold text-gray-900 dark:text-gray-50">
                    {formData.Title ? formData.Title : 'No Value Provided'}
                  </h1>
                  <div className="py-3 xl:pt-3 xl:pb-0">
                    <Tabs selected={selectedTab} onSelect={handleTabChange}>
                      <Tab title="General">
                        <div className="grid grid-cols-1 overflow-y-auto xl:grid-cols-3 xl:gap-4">
                          <div className="col-span-1 pt-4 xl:col-span-3">
                            <h2 className="text-lg font-semibold text-gray-200">
                              Description
                            </h2>
                            <div className="mb-8 prose dark:text-gray-200 max-w-none">
                              <p>
                                {formData.Description
                                  ? formData.Description
                                  : 'No Value Provided'}
                              </p>
                            </div>
                          </div>
                          <div className="">
                            <h2 className="font-semibold text-gray-200 ">County FIPS</h2>
                            <div className="prose dark:text-gray-200 max-w-none">
                              <p>
                                {formData['CountyFIPS']
                                  ? formData['CountyFIPS']
                                  : 'No Value Provided'}
                              </p>
                            </div>
                          </div>
                          <div className="">
                            <h2 className="font-semibold text-gray-200 ">Expires in: </h2>
                            <div className="prose dark:text-gray-200 max-w-none">
                              <p>
                                {formData.ExpiresInHours +
                                  ' Hour(s), ' +
                                  formData.ExpiresInMinutes +
                                  ' Minute(s)'}
                              </p>
                            </div>
                          </div>
                          {formData.WEA && (
                            <>
                              <div className="py-4">
                                <h2 className="font-semibold text-gray-300 ">
                                  WEA Short Text
                                </h2>
                                <div className="prose dark:text-gray-200 max-w-none">
                                  <p>
                                    {formData.WEAShortText
                                      ? formData.WEAShortText
                                      : 'No Value Provided'}
                                  </p>
                                </div>
                              </div>
                              <div className="py-4">
                                <h2 className="font-semibold text-gray-200 ">
                                  WEA Long Text
                                </h2>
                                <div className="prose dark:text-gray-200 max-w-none">
                                  <p>
                                    {formData.WEALongText
                                      ? formData.WEALongText
                                      : 'No Value Provided'}
                                  </p>
                                </div>
                              </div>
                              {formData.WEASpanish && (
                                <>
                                  <div className="py-4">
                                    <h2 className="font-semibold text-gray-200 ">
                                      WEA Short Text (Spanish)
                                    </h2>
                                    <div className="prose dark:text-gray-200 max-w-none">
                                      <p>
                                        {formData.WEAShortTextSpanish
                                          ? formData.WEAShortTextSpanish
                                          : 'No Value Provided'}
                                      </p>
                                    </div>
                                  </div>
                                  <div className="py-4">
                                    <h2 className="font-semibold text-gray-200 ">
                                      WEA Long Text (Spanish)
                                    </h2>
                                    <div className="prose dark:text-gray-200 max-w-none">
                                      <p>
                                        {formData.WEALongTextSpanish
                                          ? formData.WEALongTextSpanish
                                          : 'No Value Provided'}
                                      </p>
                                    </div>
                                  </div>
                                </>
                              )}
                            </>
                          )}
                        </div>
                      </Tab>
                      {formData.Type === 'IPAWS' && (
                        <Tab title="IPAWS">
                          <div className="h-auto overflow-y-auto">
                            <div className="grid grid-cols-3 py-4 border-gray-200 gap-y-6">
                              <div className="col-span-3">
                                <h2 className="text-sm font-semibold text-gray-300">
                                  Instructions
                                </h2>
                                <div className="prose dark:text-gray-200 max-w-none">
                                  <p>
                                    {formData.Instructions
                                      ? formData.Instructions
                                      : 'No Value Provided'}
                                  </p>
                                </div>
                              </div>
                              <div>
                                <h2 className="text-sm font-semibold text-gray-300">
                                  Distribution Channels
                                </h2>
                                <div className="prose dark:text-gray-200 max-w-none">
                                  <p>{disseminationChannels.join(', ')}</p>
                                </div>
                              </div>
                              <div>
                                <h2 className="text-sm font-semibold text-gray-300">
                                  Event Code
                                </h2>
                                <div className="prose dark:text-gray-200 max-w-none">
                                  <p>{eventCodes[formData['EventCode']]?.name}</p>
                                </div>
                              </div>
                              <div>
                                <h2 className="text-sm font-semibold text-gray-300">
                                  Event Response
                                </h2>
                                <div className="m-1">
                                  <Badge
                                    color={
                                      eventResponseMap[formData['EventResponse']]?.color
                                    }
                                  >
                                    {eventResponseMap[formData['EventResponse']]?.name}
                                  </Badge>
                                </div>
                              </div>
                              <div>
                                <h2 className="text-sm font-semibold text-gray-300">
                                  Alert Category
                                </h2>
                                <div className="m-1">
                                  <Badge
                                    color={categoryMap[formData['AlertCategory']]?.color}
                                  >
                                    {categoryMap[formData['AlertCategory']]?.name}
                                  </Badge>
                                </div>
                              </div>
                              <div>
                                <h2 className="text-sm font-semibold text-gray-300">
                                  Severity
                                </h2>
                                <div className="m-1">
                                  {formData.WEA ? (
                                    <Badge
                                      color={weaSeverityMap[formData.Severity]?.color}
                                    >
                                      {weaSeverityMap[formData.Severity]?.name}
                                    </Badge>
                                  ) : (
                                    <Badge color={severityMap[formData.Severity]?.color}>
                                      {severityMap[formData.Severity]?.name}
                                    </Badge>
                                  )}
                                </div>
                              </div>
                              <div>
                                <h2 className="text-sm font-semibold text-gray-300">
                                  Urgency
                                </h2>
                                <div className="m-1">
                                  {formData.WEA ? (
                                    <Badge color={weaUrgencyMap[formData.Urgency]?.color}>
                                      {weaUrgencyMap[formData.Urgency]?.name}
                                    </Badge>
                                  ) : (
                                    <Badge color={urgencyMap[formData.Urgency]?.color}>
                                      {urgencyMap[formData.Urgency]?.name}
                                    </Badge>
                                  )}
                                </div>
                              </div>
                              <div>
                                <h2 className="text-sm font-semibold text-gray-300">
                                  Certainty
                                </h2>
                                <div className="m-1">
                                  {formData.WEA ? (
                                    <Badge
                                      color={weaCertaintyMap[formData.Certainty]?.color}
                                    >
                                      {weaCertaintyMap[formData.Certainty]?.name}
                                    </Badge>
                                  ) : (
                                    <Badge
                                      color={certaintyMap[formData.Certainty]?.color}
                                    >
                                      {certaintyMap[formData.Certainty]?.name}
                                    </Badge>
                                  )}
                                </div>
                              </div>
                              {formData['WEA Handling'] && (
                                <div>
                                  <h2 className="text-sm font-semibold text-gray-300">
                                    WEA Handling
                                  </h2>
                                  <div className="m-1">
                                    <Badge
                                      color={
                                        weaHandlingMap[formData['WEAHandling']]?.color
                                      }
                                    >
                                      {weaHandlingMap[formData['WEAHandling']]?.name}
                                    </Badge>
                                  </div>
                                </div>
                              )}
                            </div>
                          </div>
                        </Tab>
                      )}
                      <Tab title="Locations">
                        <DetailMap locations={JSON.parse(formData.Locations)} />
                      </Tab>
                    </Tabs>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </ModalCustom>
        <div className="px-6 py-6 bg-gray-200 dark:bg-gray-800 sm:px-6 ">
          <h2 className="text-lg font-semibold text-red-400">
            You are sending as {userName}.
          </h2>
          <Checkbox onChange={() => toggleDisabled(false)}>
            I, {userName}, by checking this box do hereby accept responsibility for
            sending out this notification in ensuring public safety and emergency
            preparedness.
          </Checkbox>
        </div>
      </Modal>
    )
  )
}

export default SubmissionModal
import { Modal, ModalText, useToast } from '@ocv-web/ui'
import Portal from '../../../portal/portal'
import { useNotificationStatus } from '../../api/notifications'
import { useHistory, useLocation } from 'react-router-dom'
import React from 'react'
<<<<<<< HEAD
import { useUser } from '../../../administration/api/users'
import { useUserSelection } from '../../../core/context/UserSelectionContext'

=======
import { useHistory, useParams } from 'react-router-dom'
import { OCVRouteParams } from '../../../core/types'
import { useNotification } from '../../api/notifications'
import AWS from 'aws-sdk'
import { Auth } from 'aws-amplify'
>>>>>>> master
export interface IIPAWSCancelModal {
  show: boolean
  showAction: () => void
  cancelItem: any
}

<<<<<<< HEAD
export const IPAWSCancelModal: React.FC<IIPAWSCancelModal> = ({
  show,
  showAction,
  cancelItem,
}) => {
  const { userEmail } = useUserSelection()
  const { data } = useUser(userEmail)
  const userName = data?.Results[0]?.Name
  const cancelItemId = cancelItem?.SK?.split('#')[1]
  const history = useHistory()
  const location = useLocation()
  const [mutatePatch] = useNotificationStatus(cancelItemId)
=======
async function invokeLambda(params) {
  Auth.currentCredentials().then(async credentials => {
    const lambda = new AWS.Lambda({
      region: 'us-east-2',
      credentials: Auth.essentialCredentials(credentials),
    })
    const lambdaParams = {
      FunctionName:
        'arn:aws:lambda:us-east-2:730987745435:function:ipawsCancelAlert' /* required */,
      InvocationType: 'RequestResponse',
      Payload: JSON.stringify({
        sender: params.sender,
        messageId: params.messageId,
        sentOn: params.sentOn,
      }),
    }
    try {
      console.log('calling lambda')
      const resp = await lambda.invoke(lambdaParams).promise()
      console.log(resp)
    } catch (err) {
      console.log(err)
    }
  })
}

export const IPAWSCancelModal: React.FC<IIPAWSCancelModal> = ({ show, showAction }) => {
  const { id } = useParams<OCVRouteParams>()
  const { data } = useNotification(id)
  React.useEffect(() => {
    console.log(data?.Results[0])
  }, [data])
>>>>>>> master
  const { dispatch } = useToast()
  const handleCancel = () => {
    console.log('cancel')
    invokeLambda({
      sender: data.Results[0].Response.body.sender,
      messageId: data.Results[0].Response.body.alertId,
      sentOn: data.Results[0].Response.body.sentOn,
    })
    // // add cancel api call here
    // const lambdaParams = {
    //   FunctionName:
    //     'arn:aws:lambda:us-east-2:730987745435:function:ipawsCancelAlert' /* required */,
    //   InvocationType: 'RequestResponse',
    //   Payload: {
    //     sender: data.Results[0].Response.body.sender,
    //     messageId: data.Results[0].Response.body.alertId,
    //     sentOn: data.Results[0].Response.body.sentOn,
    //   },
    // }
    // try {
    //   console.log('calling lambda')
    //   const resp = lambda.invoke(lambdaParams)
    //   console.log(resp)
    // } catch (err) {
    //   console.log(err)
    // }
    try {
      mutatePatch({
        Status: 'Inactive',
        Title: cancelItem.Title,
        Description: cancelItem.Description,
        Type: cancelItem.Type,
        SentBy: { Name: userName, Email: userEmail },
        Locations: cancelItem.Locations,
        Expires: {
          Hours: 0,
          Minutes: 0,
        },
        SocialMedia: {
          Facebook: false,
          Twitter: false,
          Instagram: false,
        },
        FeatureToOpen: '',
        Groups: [],
        LastUpdated: new Date().toLocaleString(),
      })
      dispatch({
        type: 'add',
        payload: {
          title: 'Notification Cancelled Successfully.',
          status: 'success',
          message: 'You successfully cancelled this MAXX Notification.',
        },
      })
      showAction()
      if (location.pathname === '/maxx/history') {
        setTimeout(() => {
          window.location.reload()
        }, 1000)
      } else {
        history.push('/maxx/history')
        setTimeout(() => {
          window.location.reload()
        }, 1000)
      }
    } catch {
      dispatch({
        type: 'add',
        payload: {
          title: 'Failed to Cancel Notification.',
          status: 'error',
          message: 'You failed to cancel this notification.',
        },
      })
      showAction()
    }
  }
  return (
    show && (
      <Portal id="root">
        <Modal
          buttons
          width="lg"
          buttonColor="red"
          show={show}
          onCancel={() => showAction()}
          onClick={() => {
            handleCancel()
          }}
          buttonTitle="Cancel Notification"
        >
          <ModalText
            icon="exclamation-triangle"
            iconColor="red"
            title="Cancel Notification"
            subtitle="Are you sure you want to cancel this notification? This action cannot be undone."
          />
        </Modal>
      </Portal>
    )
  )
}

export default IPAWSCancelModal
<div class="loading-box">

  <p class="loading-title">Loading</p>

  <div class="loading-circle">

    <p class="loading-count"><span id="loadingNumber">0</span>%</p>

  </div>

</div>
* {
    padding: 0;
    margin: 0;
}

.portfolio-grid-container {
    max-width: 90vw;
    width: 95%;
    margin: auto;
    padding: 30px;
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.photo {
    position: relative;
    cursor: pointer;
}

.photo img {
    width: 100%;
    height: 100%;
    border-radius: 1px;
    filter: brightness(100%);
    border: none;
    animation: fadeIn 1s;
    transition: filter 0.5s ease, border 1s ease, width 0.5s ease, height 0.5s ease, animation 0.8s ease-in-out;
}

.photo img.enlarged {
    max-width: 90vw;
    max-height: 700px;
    margin-top: 60px !important;
    margin-bottom: 90px;
    width: auto;
    height: auto;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 995;
    filter: brightness(100%) !important;
    background-color: rgba(255, 255, 255, 0.482);
    border: 30px solid rgba(255, 255, 255, 0.363);
    animation: fadeIn 1s;
}

.photo.enlarged:hover .portfolio-text {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.photo:hover .portfolio-text {
    opacity: 1;
    cursor: pointer;
}

.photo:hover img {
    filter: brightness(80%);
}

.portfolio-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 10px;
    text-align: center;
    opacity: 0;
    transition: opacity 1s ease;
    z-index: 994 !important;
}

.portfolio-text h2 {
    font-family: 'Julius Sans One';
    color: white;
    font-size: 30px;
    font-weight: 700;
}

.portfolio-text h3 {
    font-family: 'Nunito';
    color: white;
    font-weight: light;
    font-size: 15px;
}

@media (max-width: 1380px) {
    .photo-gallery {
        display: grid;
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 965px) {
    .photo-gallery {
        display: grid;
        grid-template-columns: repeat(1, 1fr) !important;
    }
}
<?php get_header(); ?>

<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
    <meta charset="<?php bloginfo('charset'); ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/portfolio.css">
    <?php wp_head(); ?>
</head>

<body>
    <div class="overlay"></div>
    <h1 class="page-title">Photography Portfolio</h1>
    <div class="portfolio-grid-container">
        <div class="photo-gallery">
            <?php
            $portfolio_query = new WP_Query(array('post_type' => 'portfolio', 'posts_per_page' => -1));

            if ($portfolio_query->have_posts()) :
                $count = 0;

                while ($portfolio_query->have_posts()) : $portfolio_query->the_post();
                    $image_url = get_the_post_thumbnail_url(get_the_ID(), 'full');
                    $location = get_the_content();

                    if ($count % 7 === 0) {
                        echo '<div class="column">';
                    }
                    ?>
                    <div class="photo">
                        <img src="<?php echo esc_url($image_url); ?>" onclick="enlargeImg(this)" alt="">
                        <div class="portfolio-text">
                            <?php echo wp_kses_post($location); ?>
                        </div>
                    </div>
                    <?php
                    $count++;

                    if ($count % 7 === 0) {
                        echo '</div>';
                    }
                endwhile;

                if ($count % 7 !== 0) {
                    echo '</div>';
                }

                wp_reset_postdata();
            else :
                echo 'No portfolio items found.';
            endif;
            ?>
        </div>
    </div>
</body>

<?php
/*
Template Name: Photography Portfolio
*/
$portfolio_query = new WP_Query(array(
    'post_type' => 'portfolio',
    'posts_per_page' => -1,
));

if ($portfolio_query->have_posts()) :
    while ($portfolio_query->have_posts()) :
        $portfolio_query->the_post();
    endwhile;
    wp_reset_postdata();
else :
    echo 'No portfolio items found.';
endif;

get_footer(); ?>
    const images = [
        "https://dannyholmanmedia.com/wp-content/uploads/2023/11/DGH_Carousel.png",
    
    ];

    const carousel = document.getElementById("carousel");

    images.forEach((imageUrl) => {
        const img = document.createElement("img");
        img.src = imageUrl;
        carousel.appendChild(img.cloneNode(true));
    });


 const slideshowImages = [
    "https://dannyholmanmedia.com/wp-content/uploads/2023/09/Portfolio-8.jpg",
    "https://dannyholmanmedia.com/wp-content/uploads/2023/09/Portfolio_2023-5.jpg",
    "https://dannyholmanmedia.com/wp-content/uploads/2023/09/Portfolio-12.jpg",
    "https://dannyholmanmedia.com/wp-content/uploads/2023/09/Portfolio-5.jpg",
    "https://dannyholmanmedia.com/wp-content/uploads/2023/09/Portfolio_2023-2.jpg",
    "https://dannyholmanmedia.com/wp-content/uploads/2023/09/Portfolio-21.jpg",
    "https://dannyholmanmedia.com/wp-content/uploads/2023/09/Portfolio-16.jpg",
    "https://dannyholmanmedia.com/wp-content/uploads/2023/11/Home-Background-scaled.jpg",


];

const heroBackground = document.getElementById("heroBackground");
let currentImageIndex = 0;

function updateHeroBackground() {
    heroBackground.style.opacity = .0;

    // After a short delay, update the image source and fade in
    setTimeout(() => {
        heroBackground.src = slideshowImages[currentImageIndex];
        heroBackground.style.opacity = .4;
    }, 1000);

    currentImageIndex = (currentImageIndex + 1) % slideshowImages.length;
}

setInterval(updateHeroBackground, 5000);
body {
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.nav-menu .cart-icon {
    display: inline-block;
    background: url('https://dannyholmanmedia.com/wp-content/uploads/2023/11/Icons-1.png') no-repeat;
    width: 30px;
    height: 30px;
    background-size: contain;
    text-indent: 35px;
    font-family: 'montserrat';
    font-weight: 700;
}

header {
    position: fixed;
    height: 140px;
    transition: 0.5s ease;
    width: 100%;
    top: 0px;
    background-color: black;
    padding-top: 0px;
    z-index: 999;
    padding-bottom: 0px;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    align-items: center;
}

header #site-logo {
    display: flex;
    align-items: center;
    height: 100%;
}

header #header-logo {
    max-width: 100%;
    width: 150px;
    height: auto;
    padding-left: 0px;
    transition: width 0.5s ease;
    padding-top: 10px;
}

header.small {
    height: 50px;
    background-color: #515151;
}

header.small img {
    width: 10vw;
}

header.small #site-logo {
    display: flex;
    align-items: center;
    height: 100%;
}

header.small #header-logo {
    max-width: 100%;
    width: 60px;
    height: auto;
    padding-left: 0px;
}

@media (max-width: 900px) {
    header {
        position: fixed;
        top: 0px;
        height: 130px;
        transition: 0.5s ease;
    }

    header.small {
        position: fixed;
        top: 0px;
        height: 90px;
    }

    header.small #site-logo {
        display: flex;
        align-items: center;
        height: 100%;
    }

    header.small #header-logo {
        max-width: 100%;
        width: 90px;
        height: auto;
        padding-left: 0px;
    }
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

a {
    color: white;
    text-decoration: none;
    position: center;
}

.navbar {
    text-align: center;
    font-family: 'Julius Sans One', sans-serif;
}

#site-menu {
    justify-content: center;
}

.nav-menu {
    display: flex;
    justify-content: space-between;
    width: 100%;
    text-align: center;
    font-family: 'Julius Sans One', sans-serif;
    white-space: nowrap;
    align-items: center;
}

.nav-menu li {
    position: relative;
    margin: 5px 3vw;
    font-size: 15px;
}

.nav-menu a::before {
    content: "";
    position: absolute;
    width: 0;
    height: 4px;
    background-color: transparent;
    bottom: -6px;
    left: 0;
    transform-origin: left;
    transition: width 0.6s ease;
}

.nav-menu a:hover::before {
    width: 100%;
    transform: translateX(0);
    background-color: #4A1521;
}

.nav-link {
    transition: 0.3s ease;
}

.nav-link.hover {
    text-decoration: underline;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    position: absolute;
    z-index: 999;
    align-items: center;
    padding-bottom: 30px;
}

.bar {
    display: block;
    width: 30px;
    height: 3px;
    margin: 5px;
    transition: all 0.3s ease-in-out;
    background-color: white;
    border-radius: 300px;
}

@media (max-width: 900px) {
    .hamburger {
        display: block;
        right: 20px;
        top: 20px;
    }
}

.bar {
    display: block;
    width: 30px;
    height: 3px;
    margin: 5px;
    transition: all 0.3s ease-in-out;
    background-color: white;
    border-radius: 300px;
}

.page-title {
    padding-top: 15px;
    padding-bottom: 15px;
    margin-bottom: 15px;
    position: relative;
    animation: fadeIn 4s ease-out;
    display: flex;
    justify-content: center;
    font-size: 60px;
    padding-bottom: 60px;
}

.contact-content {
    padding-left: 300px;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@media (max-width: 900px) {
    #header-logo {
        position: sticky;
        margin: 0;
        align-items: center;
        display: flex;
        flex-direction: row;
    }

    .hamburger {
        display: block;
        cursor: pointer;
        position: relative;
        z-index: 999;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(315deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-315deg);
    }

    .nav-menu a {
        position: relative;
        padding: 20px;
        text-decoration: none !important;
        transition: color 0.3s ease;
        font-size: 35px;
    }

    .nav-menu a::before {
        content: "";
        position: absolute;
        width: 0;
        height: 4px;
        background-color: transparent;
        bottom: -6px;
        transform: translateX(-50%) translateY(50%);
        transform-origin: left;
        transition: width 0.3s ease;
    }

    .nav-menu a:hover {
        color: #000000 !important;
    }

    .nav-menu a:hover::before {
        width: 100%;
        transform: translateX(-50%) translateY(50%);
        background-color: transparent;
    }

    .nav-menu {
        position: fixed;
        right: -200%;
        top: 0;
        gap: 0;
        flex-direction: column;
        width: 100%;
        height: 100%;
        text-align: center;
        color: black;
        transition: right 0.5s ease-in-out;
        background: #4a1521
<header>
    <div id="site-logo">
        <a href="<?php echo esc_url(home_url('/')); ?>">
            <img id="header-logo" src="https://dannyholmanmedia.com/wp-content/uploads/2023/11/DGH-Media-Logo_2024.png" alt="Turn this into a logo">
        </a>
    </div>

    <div id="site-menu">
        <nav class="navbar">
            <ul class="nav-menu">
                <li class="nav-item"><a href="https://dannyholmanmedia.com/about" class="nav-link">About</a></li>
                <li class="nav-item"><a href="https://dannyholmanmedia.com/portfolio" class="nav-link">Portfolio</a></li>
                <li class="nav-item"><a href="https://dannyholmanmedia.com/photo-portfolio" class="nav-link">Photography</a></li>
                <li class="nav-item"><a href="https://dannyholmanmedia.com/order-prints" class="nav-link">Order Prints</a></li>
                <li class="nav-item"><a href="https://dannyholmanmedia.com/contact" class="nav-link">Contact</a></li>

                <li class="nav-item">
                    <a href="<?php echo esc_url(wc_get_cart_url()); ?>" class="nav-link cart-icon">
                        <?php
                        $cart_count = WC()->cart->get_cart_contents_count();
                        if ($cart_count > 0) {
                            echo '(' . esc_html($cart_count) . ')';
                        }
                        ?>
                    </a>
                </li>
            </ul>
        </nav>

        <div class="hamburger">
            <span class="bar"></span>
            <span class="bar"></span>
            <span class="bar"></span>
        </div>
    </div>
</header>
const text3 = document.querySelector('.text3');
const img3 = document.querySelector('.img3');

function animateElement(element, offset) {
    const elementPosition = element.getBoundingClientRect().top;
    const screenPosition = window.innerHeight / offset;

    if (elementPosition < screenPosition) {
        element.classList.add('animate');
    } else {
        element.classList.remove('animate');
    }
}

function animate() {
    animateElement(text3, 1.3);
    animateElement(img3, 1.3);
}

window.addEventListener('scroll', animate);
<!DOCTYPE html>
<html>
<head>
    <title>Table with Flip Cards</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
    <div class="cards">
        <table id="SDGtop">
            <tr>
                <td>
                    <a href="#SDG3">
                        <div class="flip-card">
                            <div class="flip-card-inner">
                                <div class="flip-card-front">
                                    <img src="https://cleanlightingcoalition.org/wp-content/uploads/sites/96/SDG3-ICON.svg" width="300" height="300">
                                </div>
                                <div class="flip-card-back">
                                    <img src="https://cleanlightingcoalition.org/wp-content/uploads/sites/96/SDG-3.svg" width="300" height="300">
                                </div>
                            </div>
                        </div>
                    </a>
                </td>
                <td>
                    <a href="#SDG7">
                        <div class="flip-card">
                            <div class="flip-card-inner">
                                <div class="flip-card-front">
                                    <img src="https://cleanlightingcoalition.org/wp-content/uploads/sites/96/SDG7-ICON.svg" width="300" height="300">
                                </div>
                                <div class="flip-card-back">
                                    <img src="https://cleanlightingcoalition.org/wp-content/uploads/sites/96/SDG-7.svg" width="300" height="300">
                                </div>
                            </div>
                        </div>
                    </a>
                </td>
                <td>
                    <a href="#SDG8">
                        <div id="flipcard" class="flip-card">
                            <div class="flip-card-inner">
                                <div class="flip-card-front">
                                    <img src="https://cleanlightingcoalition.org/wp-content/uploads/sites/96/SDG8-ICON.svg" width="300" height="300">
                                </div>
                                <div class="flip-card-back">
                                    <img src="https://cleanlightingcoalition.org/wp-content/uploads/sites/96/SDG-8.svg" width="300" height="300">
                                </div>
                            </div>
                        </div>
                    </a>
                </td>
                <td>
                    <a href="#SDG10">
                        <div class="flip-card">
                            <div class="flip-card-inner">
                                <div class="flip-card-front">
                                    <img src="https://cleanlightingcoalition.org/wp-content/uploads/sites/96/SDG10-ICON.svg" width="300" height="300">
                                </div>
                                <div class="flip-card-back">
                                    <img src="https://cleanlightingcoalition.org/wp-content/uploads/sites/96/SDG-10.svg" width="300" height="300">
                                </div>
                            </div>
                        </div>
                    </a>
                </td>
            </tr>
            <tr>
                <td>
                    <a href="#SDG11">
                        <div class="flip-card">
                            <div class="flip-card-inner">
                                <div class="flip-card-front">
                                    <img src="https://cleanlightingcoalition.org/wp-content/uploads/sites/96/SDG11-ICON.svg" width="300" height="300">
                                </div>
                                <div class "flip-card-back">
                                    <img src="https://cleanlightingcoalition.org/wp-content/uploads/sites/96/SDG-11.svg" width="300" height="300">
                                </div>
                            </div>
                        </div>
                    </a>
                </td>
                <td>
                    <a href="#SDG12">
                        <div class="flip-card">
                            <div class="flip-card-inner">
                                <div class="flip-card-front">
                                    <img src="https://cleanlightingcoalition.org/wp-content/uploads/sites/96/SDG12-ICON.svg" width="300" height="300">
                                </div>
                                <div class="flip-card-back">
                                    <img src="https://cleanlightingcoalition.org/wp-content/uploads/sites/96/SDG-12.svg" width="300" height="300">
                                </div>
                            </div>
                        </div>
                    </a>
                </td>
                <td>
                    <a href="#SDG13">
                        <div class="flip-card">
                            <div class="flip-card-inner">
                                <div class="flip-card-front">
                                    <img src="https://cleanlightingcoalition.org/wp-content/uploads/sites/96/SDG13-ICON.svg" width="300" height="300">
                                </div>
                                <div class="flip-card-back">
                                    <img src="https://cleanlightingcoalition.org/wp-content/uploads/sites/96/SDG-13.svg" width="300" height="300">
                                </div>
                            </div>
                        </div>
                    </a>
                </td>
                <td>
                    <a href="#SDG14">
                        <div class="flip-card">
                            <div class="flip-card-inner">
                                <div class="flip-card-front">
                                    <img src="https://cleanlightingcoalition.org/wp-content/uploads/sites/96/SDG14-ICON.svg" width="300" height="300">
                                </div>
                                <div class="flip-card-back">
                                    <img src="https://cleanlightingcoalition.org/wp-content/uploads/sites/96/SDG-14.svg" width="300" height="300">
                                </div>
                            </div>
                        </div>
                    </a>
                </td>
            </tr>
        </table>
    </div>
</body>
</html>

<!DOCTYPE html>
<html>
<head>
    <title>SDG 3</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
    <div id="SDG3">
        <img class="img3" src="https://cleanlightingcoalition.org/wp-content/uploads/sites/96/SDG3-ICON.svg" width="2000" height="2000" alt="SDG 3">
        <div class="text3" style="text-align: left;">
            <h2><strong>SDG 3: Good Health and Well-being</strong></h2>
            <p style="color: black;"><strong>Ensure healthy lives and promote well-being for all at all ages</strong></p>
            <p style="color: black; font-size: 8vw;">
                Phasing out mercury-ladened fluorescent lamps will help to achieve
                <a href="https://sdgs.un.org/goals/goal3">objective 3.9</a>
                which seeks to substantially reduce the number of deaths and illnesses from hazardous chemicals and air, water and soil pollution and contamination.
            </p>
        </div>
    </div>
</body>
</html>
.cards {
    align-items: center;
    max-width: none;
    padding-left: 30px;
}

table {
    border-collapse: collapse;
    margin-top: auto;
    margin-bottom: auto;
    width: 100%;
    align-items: center;
}

td {
    border: 20px solid white;
    padding: 0;
    margin: auto;
}

.flip-card {
    background-color: white !important;
    border: 1px solid white;
    height: 300px;
    perspective: 1000px;
    width: auto;
    max-width: 20vw !important;
}

.flip-card-inner {
    height: 100%;
    position: relative;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    width: 100%;
    max-width: 20vw;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
    transform-origin: center !important;
}

.flip-card-front,
.flip-card-back {
    backface-visibility: hidden;
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    width: 100%;
}

.flip-card-front {
    background-color: white;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.flip-card-back {
    color: #000000;
    transform: rotateY(180deg);
    display: auto;
    align-items: center;
    justify-content: auto;
}

h5,
p {
    margin: 20px;
    color: #FFFFFF;
}

@media (min-width: 1541px) {
    .flip-card {
        width: 15vw;
    }
    .cards {
        padding-left: 100px;
    }
}

.img3 {
    max-width: 300px;
    height: auto;
    margin-left: auto;
    margin-right: auto;
    transform: translateX(-50px);
    transition: all 1.5s ease-out;
    opacity: 0;
    margin-left: 200px;
    margin-right: 20px;
}

.text3 {
    color: black;
    opacity: 0;
    transition: all 1.5s ease-out;
    transform: translateX(50px);
    text-align: left;
    font-size: 18px;
    margin-left: 20px;
    margin-right: 20px;
}

.animate {
    opacity: 1;
    transform: translateX(0);
}

#SDG3 {
    display: flex;
    padding-top: 40px;
    padding-bottom: 40px;
}

@media (min-width: 1593px) {
    #SDG3 {
        max-width: 80vw;
        padding-left: 200px;
    }
}

@media (max-width: 1050px) {
    .text3 {
        padding-top: 30px;
        transform: translateX(0);
        max-width: 70%;
        text-align: center;
        display: block;
        margin-left: 50px;
        margin-right: 50px;
    }
    .img3 {
        transform: translateX(0);
        max-width: 300px;
        height: auto;
        display: block;
        margin-left: 50px;
        margin-right: 50px;
    }

    #SDG3 {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}
Answer 2:

public class Student {
	
	String name;
	int age;
	boolean isJunior;
	char gender;
	
	Student()
	{
		name = "Mohamed";
		age = 23;
		isJunior = false;
		gender = 'm';
	}
	Student(String nme, int n, boolean job, char gen) 
	{
		name = nme;
		age = n;
		isJunior = job;
		gender = gen;
	}
	
	public static void main(String[] args) {
		
		Student s1 = new Student();
		Student s2 = new Student("Ayşe", 15, true, 'f');
		
		System.out.println("Name S1 = " + s1.name);
		System.out.println("Age S1 = " + s1.age);
		System.out.println("isJunior S1 = " + s1.isJunior);
		System.out.println("Gender S1 = " + s1.gender);

		System.out.println("\n\nName S2 = " + s2.name);
		System.out.println("Age S2 = " + s2.age);
		System.out.println("isJunior S2 = " + s2.isJunior);
		System.out.println("Gender S2 = " + s2.gender);
	}
}
//OUTPUT:

Name S1 = Mohamed
Age S1 = 23
isJunior S1 = false
Gender S1 = m


Name S2 = Ayşe
Age S2 = 15
isJunior S2 = true
Gender S2 = f
import React from "react";
import digitalMarketing from "../assets/digitalMarketing.png";
import socialmediamarketing from "../assets/socialmediamarketing.png";
import WebDev from "../assets/WebDev.png";
import creativeDesign from "../assets/creativeDesign.png";
import seo from "../assets/seo.jpg";
import gAds from "../assets/gAds.jpg"
import localMapSearch from "../assets/localMapSearch.jpg"
import navigation from "../assets/navigation.png"

const Services = () => {
  return (
    <div className="bg-[#faedb9]  h-full pb-10 ">
      {/* Title */}
      <h2 class="mb-1 text-4xl font-extrabold text-center leading-tight text-gray-900">
        Services
      </h2>

      {/* card for larger size */}
      <div className="hidden sm:grid sm:grid-cols-2 sm:gap-y-4 sm:gap-x-4  md:gap-y-12 md:gap-x-12 xl:gap-y-12 xl:gap-x-8  sm:p-4 md:p-8 place-items-center ">
        <div className="  relative flex w-full max-w-[24rem] lg:max-w-[33rem] flex-row rounded bg-white bg-clip-border text-gray-700 shadow-md">
          <div className="relative m-0 w-2/5 shrink-0 overflow-hidden rounded-xl rounded-r-none bg-white bg-clip-border text-gray-700">
            <div className="flex justify-center items-center h-full">
              <img
                src="https://cdn3d.iconscout.com/3d/free/thumb/free-social-media-marketing-with-whatsapp-4409954-3679262.png?f=webp"
                alt=""
                srcset=""
              />
            </div>
          </div>
          <div className="p-2">
            <div className="p-6 rounded-lg">
              <h6 className="mb-4 block font-sans font-semibold text-2xl leading-relaxed tracking-normal text-pink-500 antialiased">
                Whatsapp Marketing
              </h6>
              <p class="mb-8 block font-sans text-base font-normal leading-relaxed text-black antialiased">
                Schedule Your Service in advanced With Us And Get It Done In
                Time.
              </p>
              <div to="/servicing" className="inline-block" href="#">
                <a href="#_" class="relative inline-block text-lg group">
                  <span class="relative z-10 block px-5 py-3 overflow-hidden font-medium leading-tight text-gray-800 transition-colors duration-300 ease-out border-2 border-gray-900 rounded-lg group-hover:text-white">
                    <span class="absolute inset-0 w-full h-full px-5 py-3 rounded-lg bg-gray-50"></span>
                    <span class="absolute left-0 w-48 h-48 -ml-2 transition-all duration-300 origin-top-right -rotate-90 -translate-x-full translate-y-12 bg-gray-900 group-hover:-rotate-180 ease"></span>
                    <span class="relative">Book Now</span>
                  </span>
                  <span
                    class="absolute bottom-0 right-0 w-full h-12 -mb-1 -mr-1 transition-all duration-200 ease-linear bg-gray-900 rounded-lg group-hover:mb-0 group-hover:mr-0"
                    data-rounded="rounded-lg"
                  ></span>
                </a>
              </div>
            </div>
          </div>
        </div>

        <div className="  relative flex w-full max-w-[24rem] lg:max-w-[33rem] flex-row rounded bg-white bg-clip-border text-gray-700 shadow-md">
          <div className="relative m-0 w-2/5 shrink-0 overflow-hidden rounded-xl rounded-r-none bg-white bg-clip-border text-gray-700">
            <div className="flex justify-center items-center h-full">
              <img src={digitalMarketing} alt="" srcset="" />
            </div>
          </div>
          <div className="p-2">
            <div className="p-6 rounded-lg">
              <h6 className="mb-4 block font-sans font-semibold text-2xl leading-relaxed tracking-normal text-pink-500 antialiased">
                Digital marketing
              </h6>
              <p class="mb-8 block font-sans text-base font-normal leading-relaxed text-black antialiased">
                Schedule Your Service in advanced With Us And Get It Done In
                Time.
              </p>
              <div to="/servicing" className="inline-block" href="#">
                <a href="#_" class="relative inline-block text-lg group">
                  <span class="relative z-10 block px-5 py-3 overflow-hidden font-medium leading-tight text-gray-800 transition-colors duration-300 ease-out border-2 border-gray-900 rounded-lg group-hover:text-white">
                    <span class="absolute inset-0 w-full h-full px-5 py-3 rounded-lg bg-gray-50"></span>
                    <span class="absolute left-0 w-48 h-48 -ml-2 transition-all duration-300 origin-top-right -rotate-90 -translate-x-full translate-y-12 bg-gray-900 group-hover:-rotate-180 ease"></span>
                    <span class="relative">Book Now</span>
                  </span>
                  <span
                    class="absolute bottom-0 right-0 w-full h-12 -mb-1 -mr-1 transition-all duration-200 ease-linear bg-gray-900 rounded-lg group-hover:mb-0 group-hover:mr-0"
                    data-rounded="rounded-lg"
                  ></span>
                </a>
              </div>
            </div>
          </div>
        </div>

        <div className="  relative flex w-full max-w-[24rem] lg:max-w-[33rem] flex-row rounded bg-white bg-clip-border text-gray-700 shadow-md">
          <div className="relative m-0 w-2/5 shrink-0 overflow-hidden rounded-xl rounded-r-none bg-white bg-clip-border text-gray-700">
            <div className="flex justify-center items-center h-full">
              <img src={socialmediamarketing} alt="" srcset="" />
            </div>
          </div>
          <div className="p-2">
            <div className="p-6 rounded-lg">
              <h6 className="mb-4 block font-sans font-semibold text-2xl leading-relaxed tracking-normal text-pink-500 antialiased">
                Social media marketing
              </h6>
              <p class="mb-8 block font-sans text-base font-normal leading-relaxed text-black antialiased">
                Schedule Your Service in advanced With Us And Get It Done In
                Time.
              </p>
              <div to="/servicing" className="inline-block" href="#">
                <a href="#_" class="relative inline-block text-lg group">
                  <span class="relative z-10 block px-5 py-3 overflow-hidden font-medium leading-tight text-gray-800 transition-colors duration-300 ease-out border-2 border-gray-900 rounded-lg group-hover:text-white">
                    <span class="absolute inset-0 w-full h-full px-5 py-3 rounded-lg bg-gray-50"></span>
                    <span class="absolute left-0 w-48 h-48 -ml-2 transition-all duration-300 origin-top-right -rotate-90 -translate-x-full translate-y-12 bg-gray-900 group-hover:-rotate-180 ease"></span>
                    <span class="relative">Book Now</span>
                  </span>
                  <span
                    class="absolute bottom-0 right-0 w-full h-12 -mb-1 -mr-1 transition-all duration-200 ease-linear bg-gray-900 rounded-lg group-hover:mb-0 group-hover:mr-0"
                    data-rounded="rounded-lg"
                  ></span>
                </a>
              </div>
            </div>
          </div>
        </div>

        <div className="  relative flex w-full max-w-[24rem] lg:max-w-[33rem] flex-row rounded bg-white bg-clip-border text-gray-700 shadow-md">
          <div className="relative m-0 w-2/5 shrink-0 overflow-hidden rounded-xl rounded-r-none bg-white bg-clip-border text-gray-700">
            <div className="flex justify-center items-center h-full">
              <img src={WebDev} alt="" srcset="" />
            </div>
          </div>
          <div className="p-2">
            <div className="p-6 rounded-lg">
              <h6 className="mb-4 block font-sans font-semibold text-2xl leading-relaxed tracking-normal text-pink-500 antialiased">
                Website Development
              </h6>
              <p class="mb-8 block font-sans text-base font-normal leading-relaxed text-black antialiased">
                Schedule Your Service in advanced With Us And Get It Done In
                Time.
              </p>
              <div to="/servicing" className="inline-block" href="#">
                <a href="#_" class="relative inline-block text-lg group">
                  <span class="relative z-10 block px-5 py-3 overflow-hidden font-medium leading-tight text-gray-800 transition-colors duration-300 ease-out border-2 border-gray-900 rounded-lg group-hover:text-white">
                    <span class="absolute inset-0 w-full h-full px-5 py-3 rounded-lg bg-gray-50"></span>
                    <span class="absolute left-0 w-48 h-48 -ml-2 transition-all duration-300 origin-top-right -rotate-90 -translate-x-full translate-y-12 bg-gray-900 group-hover:-rotate-180 ease"></span>
                    <span class="relative">Book Now</span>
                  </span>
                  <span
                    class="absolute bottom-0 right-0 w-full h-12 -mb-1 -mr-1 transition-all duration-200 ease-linear bg-gray-900 rounded-lg group-hover:mb-0 group-hover:mr-0"
                    data-rounded="rounded-lg"
                  ></span>
                </a>
              </div>
            </div>
          </div>
        </div>

        <div className="  relative flex w-full max-w-[24rem] lg:max-w-[33rem] flex-row rounded bg-white bg-clip-border text-gray-700 shadow-md">
          <div className="relative m-0 w-2/5 shrink-0 overflow-hidden rounded-xl rounded-r-none bg-white bg-clip-border text-gray-700">
            <div className="flex justify-center items-center h-full">
              <img src={creativeDesign} alt="" srcset="" />
            </div>
          </div>
          <div className="p-2">
            <div className="p-6 rounded-lg">
              <h6 className="mb-4 block font-sans font-semibold text-2xl leading-relaxed tracking-normal text-pink-500 antialiased">
                Website Development
              </h6>
              <p class="mb-8 block font-sans text-base font-normal leading-relaxed text-black antialiased">
                Schedule Your Service in advanced With Us And Get It Done In
                Time.
              </p>
              <div to="/servicing" className="inline-block" href="#">
                <a href="#_" class="relative inline-block text-lg group">
                  <span class="relative z-10 block px-5 py-3 overflow-hidden font-medium leading-tight text-gray-800 transition-colors duration-300 ease-out border-2 border-gray-900 rounded-lg group-hover:text-white">
                    <span class="absolute inset-0 w-full h-full px-5 py-3 rounded-lg bg-gray-50"></span>
                    <span class="absolute left-0 w-48 h-48 -ml-2 transition-all duration-300 origin-top-right -rotate-90 -translate-x-full translate-y-12 bg-gray-900 group-hover:-rotate-180 ease"></span>
                    <span class="relative">Book Now</span>
                  </span>
                  <span
                    class="absolute bottom-0 right-0 w-full h-12 -mb-1 -mr-1 transition-all duration-200 ease-linear bg-gray-900 rounded-lg group-hover:mb-0 group-hover:mr-0"
                    data-rounded="rounded-lg"
                  ></span>
                </a>
              </div>
            </div>
          </div>
        </div>

        <div className="  relative flex w-full max-w-[24rem] lg:max-w-[33rem] flex-row rounded bg-white bg-clip-border text-gray-700 shadow-md">
          <div className="relative m-0 w-2/5 shrink-0 overflow-hidden rounded-xl rounded-r-none bg-white bg-clip-border text-gray-700">
            <div className="flex justify-center items-center h-full">
              <img src={seo} alt="" srcset="" />
            </div>
          </div>
          <div className="p-2">
            <div className="p-6 rounded-lg">
              <h6 className="mb-4 block font-sans font-semibold text-2xl leading-relaxed tracking-normal text-pink-500 antialiased">
                SEO Services
              </h6>
              <p class="mb-8 block font-sans text-base font-normal leading-relaxed text-black antialiased">
                Schedule Your Service in advanced With Us And Get It Done In
                Time.
              </p>
              <div to="/servicing" className="inline-block" href="#">
                <a href="#_" class="relative inline-block text-lg group">
                  <span class="relative z-10 block px-5 py-3 overflow-hidden font-medium leading-tight text-gray-800 transition-colors duration-300 ease-out border-2 border-gray-900 rounded-lg group-hover:text-white">
                    <span class="absolute inset-0 w-full h-full px-5 py-3 rounded-lg bg-gray-50"></span>
                    <span class="absolute left-0 w-48 h-48 -ml-2 transition-all duration-300 origin-top-right -rotate-90 -translate-x-full translate-y-12 bg-gray-900 group-hover:-rotate-180 ease"></span>
                    <span class="relative">Book Now</span>
                  </span>
                  <span
                    class="absolute bottom-0 right-0 w-full h-12 -mb-1 -mr-1 transition-all duration-200 ease-linear bg-gray-900 rounded-lg group-hover:mb-0 group-hover:mr-0"
                    data-rounded="rounded-lg"
                  ></span>
                </a>
              </div>
            </div>
          </div>
        </div>

        <div className="  relative flex w-full max-w-[24rem] lg:max-w-[33rem] flex-row rounded bg-white bg-clip-border text-gray-700 shadow-md">
          <div className="relative m-0 w-2/5 shrink-0 overflow-hidden rounded-xl rounded-r-none bg-white bg-clip-border text-gray-700">
            <div className="flex justify-center items-center h-full">
              <img src={gAds} alt="" srcset="" />
            </div>
          </div>
          <div className="p-2">
            <div className="p-6 rounded-lg">
              <h6 className="mb-4 block font-sans font-semibold text-2xl leading-relaxed tracking-normal text-pink-500 antialiased">
                Google Ads
              </h6>
              <p class="mb-8 block font-sans text-base font-normal leading-relaxed text-black antialiased">
                Schedule Your Service in advanced With Us And Get It Done In
                Time.
              </p>
              <div to="/servicing" className="inline-block" href="#">
                <a href="#_" class="relative inline-block text-lg group">
                  <span class="relative z-10 block px-5 py-3 overflow-hidden font-medium leading-tight text-gray-800 transition-colors duration-300 ease-out border-2 border-gray-900 rounded-lg group-hover:text-white">
                    <span class="absolute inset-0 w-full h-full px-5 py-3 rounded-lg bg-gray-50"></span>
                    <span class="absolute left-0 w-48 h-48 -ml-2 transition-all duration-300 origin-top-right -rotate-90 -translate-x-full translate-y-12 bg-gray-900 group-hover:-rotate-180 ease"></span>
                    <span class="relative">Book Now</span>
                  </span>
                  <span
                    class="absolute bottom-0 right-0 w-full h-12 -mb-1 -mr-1 transition-all duration-200 ease-linear bg-gray-900 rounded-lg group-hover:mb-0 group-hover:mr-0"
                    data-rounded="rounded-lg"
                  ></span>
                </a>
              </div>
            </div>
          </div>
        </div>

        <div className="  relative flex w-full max-w-[24rem] lg:max-w-[33rem] flex-row rounded bg-white bg-clip-border text-gray-700 shadow-md">
          <div className="relative m-0 w-2/5 shrink-0 overflow-hidden rounded-xl rounded-r-none bg-white bg-clip-border text-gray-700">
            <div className="flex justify-center items-center h-full">
              <img src={navigation} alt="" srcset="" />
            </div>
          </div>
          <div className="p-2">
            <div className="p-6 rounded-lg">
              <h6 className="mb-4 block font-sans font-semibold text-2xl leading-relaxed tracking-normal text-pink-500 antialiased">
              Local Google Map SEO
              </h6>
              <p class="mb-8 block font-sans text-base font-normal leading-relaxed text-black antialiased">
                Schedule Your Service in advanced With Us And Get It Done In
                Time.
              </p>
              <div to="/servicing" className="inline-block" href="#">
                <a href="#_" class="relative inline-block text-lg group">
                  <span class="relative z-10 block px-5 py-3 overflow-hidden font-medium leading-tight text-gray-800 transition-colors duration-300 ease-out border-2 border-gray-900 rounded-lg group-hover:text-white">
                    <span class="absolute inset-0 w-full h-full px-5 py-3 rounded-lg bg-gray-50"></span>
                    <span class="absolute left-0 w-48 h-48 -ml-2 transition-all duration-300 origin-top-right -rotate-90 -translate-x-full translate-y-12 bg-gray-900 group-hover:-rotate-180 ease"></span>
                    <span class="relative">Book Now</span>
                  </span>
                  <span
                    class="absolute bottom-0 right-0 w-full h-12 -mb-1 -mr-1 transition-all duration-200 ease-linear bg-gray-900 rounded-lg group-hover:mb-0 group-hover:mr-0"
                    data-rounded="rounded-lg"
                  ></span>
                </a>
              </div>
            </div>
          </div>
        </div>
      </div>

      {/* end card for larger size */}

      {/* ///////////////// */}

      {/*small size screen*/}
      <div className="sm:hidden grid grid-cols-2 gap-6 p-4 500:p-6 500:gap-16 font-semibold">
        {/* card1 */}

        <div to="/servicing" className="rounded-lg  flex flex-col bg-cover">
          <div className="flex justify-center">
            <div class="relative top-[10%] flex-shrink-0 w-20 h-20 mt-2  bg-red-600 border border-white text-red-500 rounded-full inline-flex items-center justify-center">
              <img
                className="w-14 h-14"
                src={digitalMarketing}
                alt=""
                srcset=""
              />
            </div>
          </div>

          <div className="bg-white rounded-b-lg text-center p-2">Servicing</div>
        </div>
        {/* card2 */}
        <div to="/modification" className="rounded-lg bg-cover flex flex-col">
          <div className="flex justify-center">
            <div class="relative top-[10%] flex-shrink-0 w-20 h-20 mt-2  bg-red-600 border border-white text-red-500 rounded-full inline-flex items-center justify-center">
              <img
                className="w-14 h-14"
                src={digitalMarketing}
                alt=""
                srcset=""
              />
            </div>
          </div>

          <div className="bg-white rounded-b-lg text-center p-2">
            Modification
          </div>
        </div>
        {/* card3 */}
        <div to="/spares" className="rounded-lg bg-cover flex flex-col">
          <div className="flex justify-center">
            <div class="relative top-[10%] flex-shrink-0 w-20 h-20 mt-2  bg-red-600 border border-white text-red-500 rounded-full inline-flex items-center justify-center">
              <img
                className="w-14 h-14"
                src={digitalMarketing}
                alt=""
                srcset=""
              />
            </div>
          </div>

          <div className="bg-white rounded-b-lg text-center p-2">
            Spare Parts
          </div>
        </div>
        {/* card4 */}
        <div to="/accessories" className="rounded-lg bg-cover flex flex-col">
          <div className="flex justify-center">
            <div class="relative top-[10%] flex-shrink-0 w-20 h-20 mt-2  bg-red-600 border border-white text-red-500 rounded-full inline-flex items-center justify-center">
              <img
                className="w-14 h-14"
                src={digitalMarketing}
                alt=""
                srcset=""
              />
            </div>
          </div>

          <div className="bg-white rounded-b-lg text-center p-2">
            Accessories
          </div>
        </div>
      </div>
    </div>
  );
};

export default Services;
Question 1. Write a method that combines two given arrays and returns the resulting array back.  Complete your program with a main method.

Answer 1:

public static void main(String[] args) {
		
		
		int[] array1 = {2,4,6,8,10,12};
		int[] array2 = {1,3,5,7,9};
		int[] array3 = {20,30,40,50,60,70,80};
		
		System.out.println("array1 = " + Arrays.toString(array1));
		System.out.println("array2 = " + Arrays.toString(array2));
		System.out.println("array3 = " + Arrays.toString(array3));
		
		int [] array4 = combineArrays(array1, array2, array3);
		
		System.out.println("\nAfter Combination of Three arrays are: ");
		
		System.out.println("\narray4 = " + Arrays.toString(array4));
		
		
		sortSmallToLarge(array4);
		System.out.println();
		System.out.println("\nAfter sorting arrays from Small number to Large number.");
		
		System.out.println(Arrays.toString(array4));
		
		
		sortLargeToSmall(array4);
		System.out.println();
		System.out.println("\nAfter sorting arrays from Large number to Small number.");
		
		System.out.println(Arrays.toString(array4));


	}
	public static int[] combineArrays(int[] array1, int[] array2, int[] array3) {
		int[] array4 = new int[array1.length + array2.length + array3.length];
		for(int i=0; i<array1.length; i++) {
			array4[i] = array1[i];
		}
		for(int i=0; i<array2.length; i++) {
			array4[array1.length + i] = array2[i];
		}
		for(int i=0; i<array3.length; i++) {
			array4[array1.length + array2.length + i] = array3[i];
		}
		return array4;
	}
	
	public static void sortSmallToLarge(int [] array4) {
		for(int i =0; i< array4.length; i++) {
			for(int j=0; j<array4.length-1-i; j++) {
				if(array4[j] > array4 [j+1]) {
					int temp = array4[j];
					array4[j] = array4[j+1];
					array4[j+1] = temp;
				}
			}
		}
	}
	public static void sortLargeToSmall(int [] array4) {
		for(int i =0; i< array4.length; i++) {
			for(int j=0; j<array4.length-1-i; j++) {
				if(array4[j] < array4 [j+1]) {
					int temp = array4[j];
					array4[j] = array4[j+1];
					array4[j+1] = temp;
				}
			}
		}
	}
}
//OUTPUT: 
array1 = [2, 4, 6, 8, 10, 12]
array2 = [1, 3, 5, 7, 9]
array3 = [20, 30, 40, 50, 60, 70, 80]

After Combination of Three arrays are: 

array4 = [2, 4, 6, 8, 10, 12, 1, 3, 5, 7, 9, 20, 30, 40, 50, 60, 70, 80]


After sorting arrays from Small number to Large number.
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 20, 30, 40, 50, 60, 70, 80]


After sorting arrays from Large number to Small number.
[80, 70, 60, 50, 40, 30, 20, 12, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]

.floor-fade {

background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.6) ), url(YOUR IMAGE HERE);

}
.text-box {

background-color: rgba(0, 0, 0, 0.5);

color: #fff;

display: inline;

padding: 10px;

}
.darken {

background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url(YOUR IMAGE HERE);

}
extends CharacterBody2D


const SPEED = 300.0
const JUMP_VELOCITY = -400.0

# Get the gravity from the project settings to be synced with RigidBody nodes.
var gravity = ProjectSettings.get_setting("physics/2d/default_gravity")


func _physics_process(delta):
	# Add the gravity.
	if not is_on_floor():
		velocity.y += gravity * delta

	# Handle Jump.
	if Input.is_action_just_pressed("ui_accept") and is_on_floor():
		velocity.y = JUMP_VELOCITY

	# Get the input direction and handle the movement/deceleration.
	# As good practice, you should replace UI actions with custom gameplay actions.
	var direction = Input.get_axis("ui_left", "ui_right")
	if direction:
		velocity.x = direction * SPEED
	else:
		velocity.x = move_toward(velocity.x, 0, SPEED)

	move_and_slide()
star

Tue Oct 24 2023 20:18:30 GMT+0000 (Coordinated Universal Time) https://amueller.github.io/aml/01-ml-workflow/12-pipelines-gridsearch.html

@elham469

star

Tue Oct 24 2023 19:42:56 GMT+0000 (Coordinated Universal Time) https://amueller.github.io/aml/01-ml-workflow/12-pipelines-gridsearch.html

@elham469

star

Tue Oct 24 2023 19:42:46 GMT+0000 (Coordinated Universal Time) undefined

@elham469

star

Tue Oct 24 2023 18:49:58 GMT+0000 (Coordinated Universal Time)

@yolobotoffender

star

Tue Oct 24 2023 17:46:38 GMT+0000 (Coordinated Universal Time)

@shirnunn

star

Tue Oct 24 2023 17:23:13 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/17541614/use-images-instead-of-radio-buttons

@benjaminb #terminal #bash

star

Tue Oct 24 2023 16:59:17 GMT+0000 (Coordinated Universal Time)

@dannyholman #css

star

Tue Oct 24 2023 16:26:10 GMT+0000 (Coordinated Universal Time)

@Mohamedshariif #java

star

Tue Oct 24 2023 15:33:39 GMT+0000 (Coordinated Universal Time)

@yolobotoffender

star

Tue Oct 24 2023 14:03:06 GMT+0000 (Coordinated Universal Time)

@AdomsNavicki

star

Tue Oct 24 2023 14:00:26 GMT+0000 (Coordinated Universal Time)

@AdomsNavicki

star

Tue Oct 24 2023 13:25:13 GMT+0000 (Coordinated Universal Time)

@AdomsNavicki

star

Tue Oct 24 2023 13:07:39 GMT+0000 (Coordinated Universal Time) selector::before{ content:""; width: 40px; height: 40px; background: linear-gradient(195deg, #FE9D01, #ED269B); position: absolute; border-radius: 100em; transition: .3s; } selector:hover::before{ width: 100%; } selector .elementor-button-text{ z-index: 1; padding: 12px 30px; }

@odesign

star

Tue Oct 24 2023 11:22:16 GMT+0000 (Coordinated Universal Time) https://yandeu.github.io/js-book/book/chapters/objects-and-arrays.html

@jamu_88_77

star

Tue Oct 24 2023 11:22:13 GMT+0000 (Coordinated Universal Time) https://yandeu.github.io/js-book/book/chapters/objects-and-arrays.html

@jamu_88_77

star

Tue Oct 24 2023 11:22:10 GMT+0000 (Coordinated Universal Time) https://yandeu.github.io/js-book/book/chapters/objects-and-arrays.html

@jamu_88_77

star

Tue Oct 24 2023 11:22:06 GMT+0000 (Coordinated Universal Time) https://yandeu.github.io/js-book/book/chapters/objects-and-arrays.html

@jamu_88_77

star

Tue Oct 24 2023 10:56:07 GMT+0000 (Coordinated Universal Time)

@Isha_1522

star

Tue Oct 24 2023 10:53:23 GMT+0000 (Coordinated Universal Time)

@Isha_1522

star

Tue Oct 24 2023 10:51:18 GMT+0000 (Coordinated Universal Time)

@Isha_1522

star

Tue Oct 24 2023 10:29:17 GMT+0000 (Coordinated Universal Time)

@Isha_1522

star

Tue Oct 24 2023 10:23:58 GMT+0000 (Coordinated Universal Time)

@Isha_1522

star

Tue Oct 24 2023 10:18:28 GMT+0000 (Coordinated Universal Time)

@usman_hamed

star

Tue Oct 24 2023 10:05:18 GMT+0000 (Coordinated Universal Time)

@usman_hamed

star

Tue Oct 24 2023 10:03:27 GMT+0000 (Coordinated Universal Time)

@usman_hamed

star

Tue Oct 24 2023 10:01:55 GMT+0000 (Coordinated Universal Time)

@usman_hamed

star

Tue Oct 24 2023 08:35:34 GMT+0000 (Coordinated Universal Time)

@riyadhbin

star

Tue Oct 24 2023 08:31:44 GMT+0000 (Coordinated Universal Time) https://chen-studio.co.il/wp-admin/admin.php?page

@chen #undefined

star

Tue Oct 24 2023 08:03:32 GMT+0000 (Coordinated Universal Time)

@jpooril

star

Tue Oct 24 2023 04:46:28 GMT+0000 (Coordinated Universal Time)

@Alihaan #php

star

Mon Oct 23 2023 19:43:02 GMT+0000 (Coordinated Universal Time)

@bfpulliam #react.js

star

Mon Oct 23 2023 19:41:54 GMT+0000 (Coordinated Universal Time)

@bfpulliam #react.js

star

Mon Oct 23 2023 19:38:04 GMT+0000 (Coordinated Universal Time) https://codepen.io/Robinskie/pen/LYjYgzB

@vipinsingh #undefined

star

Mon Oct 23 2023 18:44:17 GMT+0000 (Coordinated Universal Time)

@dannyholman #css

star

Mon Oct 23 2023 18:43:55 GMT+0000 (Coordinated Universal Time)

@dannyholman #css

star

Mon Oct 23 2023 18:37:18 GMT+0000 (Coordinated Universal Time)

@dannyholman #css

star

Mon Oct 23 2023 18:32:39 GMT+0000 (Coordinated Universal Time)

@dannyholman #css

star

Mon Oct 23 2023 18:30:28 GMT+0000 (Coordinated Universal Time)

@dannyholman #css

star

Mon Oct 23 2023 18:16:16 GMT+0000 (Coordinated Universal Time)

@dannyholman #javascript

star

Mon Oct 23 2023 18:11:11 GMT+0000 (Coordinated Universal Time)

@dannyholman #css

star

Mon Oct 23 2023 18:06:44 GMT+0000 (Coordinated Universal Time) https://cleanlightingcoalition.org/transitioning-to-leds-bolsters-8-sdgs/

@dannyholman #css

star

Mon Oct 23 2023 17:53:35 GMT+0000 (Coordinated Universal Time)

@Mohamedshariif #java

star

Mon Oct 23 2023 17:19:50 GMT+0000 (Coordinated Universal Time)

@alokmotion

star

Mon Oct 23 2023 17:07:17 GMT+0000 (Coordinated Universal Time)

@Mohamedshariif #java

star

Mon Oct 23 2023 16:43:56 GMT+0000 (Coordinated Universal Time)

@yehehehe #wot

star

Mon Oct 23 2023 10:32:52 GMT+0000 (Coordinated Universal Time) selector{ overflow: visible; }

@odesign

star

Mon Oct 23 2023 10:22:09 GMT+0000 (Coordinated Universal Time)

@missprans #css

star

Mon Oct 23 2023 10:21:48 GMT+0000 (Coordinated Universal Time)

@missprans #css

star

Mon Oct 23 2023 10:19:44 GMT+0000 (Coordinated Universal Time)

@missprans #css

star

Mon Oct 23 2023 07:43:49 GMT+0000 (Coordinated Universal Time)

@naisuu

Save snippets that work with our extensions

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