Snippets Collections
a=str(input("enter name"))
b=str(input("enter address"))
c=str(input("enter gmail"))
d=int(input("enter phone number"))
print(a,b,c,d)
import math
x1=int(input("enter x1"))
y1=int(input("enter y1"))
x2=int(input("enter x2"))
y2=int(input("enter y2"))
d=math.sqrtd=math.sqrt((x1-x2)**2+(y1-y2)**2)
print (d)
principal=int(input("enter principal"))
rate=int(input("enter rate"))
time=int(input("enter time"))
a=principal*((1+rate)/100**time)
print(a)
a=int(input("enter a"))
b=int(input("enter b"))
o=input("enter the o")
if(o=='+'):
    print(a+b)
if(o=='-'):
    print(a-b)
if(o=='/'):
    print(a/b)
if(o=='*'):
    print(a*b)
 npx expo install expo-router react-native-safe-area-context react-native-screens expo-linking expo-constants expo-status-bar
import { Client, GatewayIntentBits, Partials, PermissionsBitField, ChannelType, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } from 'discord.js';
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
import dotenv from 'dotenv';

dotenv.config();

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const prefix = process.env.DISCORD_PREFIX || '!';
const dataFilePath = new URL('data.json', import.meta.url).pathname;
let { playersELO = {}, playerWarnings = {}, karma = {}, playerStats = {} } = JSON.parse(fs.readFileSync(dataFilePath, 'utf-8') || "{}");

let queue = [];
let matchCounter = 1;
let matches = {};

const maps = ['BW', 'SB', 'PORT', 'COMP', 'ANK', 'MEX', 'EE'];

const client = new Client({
  intents: [
    GatewayIntentBits.Guilds,
    GatewayIntentBits.GuildMessages,
    GatewayIntentBits.MessageContent,
    GatewayIntentBits.GuildMembers,
    GatewayIntentBits.GuildVoiceStates,
    GatewayIntentBits.GuildPresences,
    GatewayIntentBits.GuildMessageReactions
  ],
  partials: [Partials.Channel, Partials.Message, Partials.Reaction]
});

client.once('ready', async () => {
  console.log(`Bot is ready! Logged in as ${client.user.tag}`);
  await setupQueueMessage();
});

client.on('messageCreate', async (message) => {
  if (!message.content.startsWith(prefix) || message.author.bot) return;
  const args = message.content.slice(prefix.length).trim().split(/ +/);
  const command = args.shift().toLowerCase();

  try {
    switch (command) {
      case 'report': await reportCommand(message, args); break;
      case 'clearqueue': await clearQueueCommand(message); break;
      case 'resetelo': await resetEloCommand(message); break;
      case 'giveelo': await giveEloCommand(message, args); break;
      case 'setmatchlogchannel': await setMatchLogChannelCommand(message, args); break;
      case 'profile': await profileCommand(message, args); break;
      case 'lb': case 'leaderboard': await leaderboardCommand(message); break;
      case 'elo': await eloCommand(message, args); break;
      case 'pick': await pickCommand(message, args); break;
      case 'needsub': await needSubCommand(message, args); break;
      case 'replace': await replaceCommand(message, args); break;
      case 'pt': await ptCommand(message, args); break;
      case 'cooldown': await suspendUserCommand(message, args); break;
      case 'removecd': await unSuspendUserCommand(message, args); break;
      case 'cancel': await cancelMatchCommand(message, args); break;
      case 'warn': await warnCommand(message, args); break; // Register the warn command handler
      case 'warns': await warnsCommand(message, args); break; // Register the warns command handler
    }
  } catch (error) {
    console.error(`Error executing command ${command}:`, error);
    message.reply('There was an error executing that command.');
  }
});

client.on('interactionCreate', async interaction => {
  try {
    if (interaction.isButton()) {
      if (interaction.customId === 'join_queue') {
        await joinQueue(interaction);
      } else if (interaction.customId === 'leave_queue') {
        await leaveQueue(interaction);
      } else if (interaction.customId.startsWith('map_vote')) {
        await voteMap(interaction);
      } else if (interaction.customId.startsWith('pick_')) {
        await handlePick(interaction);
      }
    } else if (interaction.isCommand()) {
      const command = interaction.commandName;
      switch (command) {
        case 'setupreaction': await setupQueueMessage(); await interaction.reply({ content: 'Queue message setup.', ephemeral: true }); break;
        case 'eloreset': if (interaction.member.permissions.has(PermissionsBitField.Flags.Administrator)) playersELO = {}; saveData(); await interaction.reply({ content: 'All ELO has been reset.', ephemeral: true }); break;
        case 'warningreset': if (interaction.member.permissions.has(PermissionsBitField.Flags.Administrator)) playerWarnings = {}; saveData(); await interaction.reply({ content: 'All warnings have been reset.', ephemeral: true }); break;
        case 'leaderboard': await leaderboardCommand(interaction); break;
      }
    }
  } catch (error) {
    console.error('Error handling interaction:', error);
    interaction.reply({ content: 'There was an error handling this interaction.', ephemeral: true });
  }
});

const setupQueueMessage = async () => {
  try {
    const channel = await client.channels.fetch(process.env.QUEUE_CHANNEL_ID);
    const embed = new EmbedBuilder()
      .setColor('#00ff26') // Set a custom color for the embed
      .setTitle('๐ŸŽฎ CSL West Competitive Queue ๐ŸŽฎ')
      .setDescription('Use the buttons below to join or leave the queue.\n\n**Current Queue:**\nNo one in the queue (0/10)')
      .setFooter({ text: 'Powered by Maverick', iconURL: 'https://i.imgur.com/wTF3RuJ.png' }); // Set an icon for the footer if you have one

    const row = new ActionRowBuilder()
      .addComponents(
        new ButtonBuilder()
          .setCustomId('join_queue')
          .setLabel('Join Queue')
          .setStyle(ButtonStyle.Success)
          .setEmoji('โœ…'), // Add an emoji to the button
        new ButtonBuilder()
          .setCustomId('leave_queue')
          .setLabel('Leave Queue')
          .setStyle(ButtonStyle.Danger)
          .setEmoji('โŒ') // Add an emoji to the button
      );

    await channel.send({ embeds: [embed], components: [row] });
  } catch (error) {
    console.error('Error setting up queue message:', error);
  }
};

const joinQueue = async (interaction) => {
  try {
    await interaction.deferReply({ ephemeral: true });

    const user = interaction.user;
    if (!queue.includes(user.id)) {
      queue.push(user.id);
      await updateQueueMessage();
      if (queue.length === 10) {
        await createMatch(interaction.guild);
      }
    } else {
      await interaction.editReply({ content: 'You are already in the queue!' });
      return;
    }

    await interaction.editReply({ content: 'You have joined the queue!' });
  } catch (error) {
    console.error('Error joining queue:', error);
    await interaction.editReply({ content: 'There was an error joining the queue.' });
  }
};

const leaveQueue = async (interaction) => {
  try {
    await interaction.deferReply({ ephemeral: true });

    const user = interaction.user;
    const index = queue.indexOf(user.id);
    if (index > -1) {
      queue.splice(index, 1);
      await updateQueueMessage();
      await interaction.editReply({ content: 'You have left the queue!' });
    } else {
      await interaction.editReply({ content: 'You are not in the queue!' });
    }
  } catch (error) {
    console.error('Error leaving queue:', error);
    await interaction.editReply({ content: 'There was an error leaving the queue.' });
  }
};

const updateQueueMessage = async () => {
  try {
    const channel = await client.channels.fetch(process.env.QUEUE_CHANNEL_ID);
    const messages = await channel.messages.fetch({ limit: 10 });
    const queueMessage = messages.find(msg => msg.embeds[0]?.title === '๐ŸŽฎ CSL West Competitive Queue ๐ŸŽฎ');

    if (queueMessage) {
      const description = queue.length > 0 
        ? `${queue.map(id => `<@${id}>`).join('\n')}\n\n**(${queue.length}/10)**`
        : 'No one in the queue (0/10)';

      const embed = new EmbedBuilder()
        .setColor('#00ff26')
        .setTitle('๐ŸŽฎ CSL West Competitive Queue ๐ŸŽฎ')
        .setDescription(`Use the buttons below to join or leave the queue.\n\n**Current Queue:**\n${description}`)
        .setFooter({ text: 'Powered by Maverick', iconURL: 'https://i.imgur.com/wTF3RuJ.png' });

      const row = new ActionRowBuilder()
        .addComponents(
          new ButtonBuilder()
            .setCustomId('join_queue')
            .setLabel('Join Queue')
            .setStyle(ButtonStyle.Success)
            .setEmoji('โœ…'),
          new ButtonBuilder()
            .setCustomId('leave_queue')
            .setLabel('Leave Queue')
            .setStyle(ButtonStyle.Danger)
            .setEmoji('โŒ')
        );

      await queueMessage.edit({ embeds: [embed], components: [row] });
    }
  } catch (error) {
    console.error('Error updating queue message:', error);
  }
};


const createMatch = async (guild) => {
  try {
    const matchCategory = guild.channels.cache.get(process.env.MATCH_CATEGORY_ID);

    const team1Voice = await guild.channels.create({
      name: `Match ${matchCounter} - Team 1`,
      type: ChannelType.GuildVoice,
      parent: matchCategory,
      userLimit: 6,
      permissionOverwrites: [
        {
          id: guild.roles.everyone.id,
          allow: [PermissionsBitField.Flags.Connect],
        },
      ],
    });

    const team2Voice = await guild.channels.create({
      name: `Match ${matchCounter} - Team 2`,
      type: ChannelType.GuildVoice,
      parent: matchCategory,
      userLimit: 6,
      permissionOverwrites: [
        {
          id: guild.roles.everyone.id,
          allow: [PermissionsBitField.Flags.Connect],
        },
      ],
    });

    const matchText = await guild.channels.create({
      name: `match-${matchCounter}`,
      type: ChannelType.GuildText,
      parent: matchCategory,
      permissionOverwrites: [
        {
          id: guild.roles.everyone.id,
          allow: [PermissionsBitField.Flags.ViewChannel, PermissionsBitField.Flags.SendMessages],
        },
      ],
    });

    const team1Captain = queue.shift();
    const team2Captain = queue.shift();
    const remainingPlayers = queue.splice(0, 8);

    const randomMap = maps[Math.floor(Math.random() * maps.length)];

    matches[matchCounter] = {
      team1: [team1Captain],
      team2: [team2Captain],
      remaining: remainingPlayers,
      pickingOrder: ['team1', 'team2', 'team2', 'team1', 'team1', 'team2', 'team2'],
      currentPick: 0,
      mapVotes: {}, // Ensure mapVotes is initialized
      chosenMap: randomMap
    };

    await updateQueueMessage();
    await updateMatchMessage(matchCounter);

    matchCounter++;
  } catch (error) {
    console.error('Error creating match:', error);
  }
};

const updateMatchMessage = async (matchNumber) => {
  try {
    const match = matches[matchNumber];
    const matchText = client.channels.cache.find(channel => channel.name === `match-${matchNumber}`);

    if (!matchText) return;

    const team1 = match.team1.map(id => `<@${id}>`).join('\n') || 'No players yet';
    const team2 = match.team2.map(id => `<@${id}>`).join('\n') || 'No players yet';

    const embed = new EmbedBuilder()
      .setTitle(`๐ŸŽฎ Match ${matchNumber} ๐ŸŽฎ`)
      .setColor('#ff4500') // Orange-red color suitable for a competitive FPS theme
      .setDescription('**Match Details**')
      .addFields(
        { name: '๐Ÿ† Team 1 Captain', value: `<@${match.team1[0]}>`, inline: true },
        { name: '๐Ÿ† Team 2 Captain', value: `<@${match.team2[0]}>`, inline: true },
        { name: '\u200B', value: '\u200B', inline: true },
        { name: '๐Ÿ‘ฅ Team 1', value: team1, inline: true },
        { name: '๐Ÿ‘ฅ Team 2', value: team2, inline: true },
        { name: '๐Ÿ—บ๏ธ Map', value: `**${match.chosenMap}**`, inline: true } // Show the chosen map
      )
      .setThumbnail('https://i.imgur.com/xfe96CL.png') // Crossfire game logo or relevant image
      .setImage('https://i.imgur.com/jyuglDa.png') // An action-packed image related to Crossfire
      .setFooter({ text: 'Powered by Maverick', iconURL: 'https://i.imgur.com/wTF3RuJ.png' })
      .setTimestamp();

    const playerPickRows = [];
    for (let i = 0; i < match.remaining.length; i += 5) {
      const row = new ActionRowBuilder()
        .addComponents(
          await Promise.all(match.remaining.slice(i, i + 5).map(async playerId => {
            const player = await client.users.fetch(playerId);
            return new ButtonBuilder()
              .setCustomId(`pick_${matchNumber}_${playerId}`)
              .setLabel(`Pick ${player.username}`)
              .setStyle(ButtonStyle.Primary);
          }))
        );
      playerPickRows.push(row);
    }

    const mapVoteRow1 = new ActionRowBuilder()
      .addComponents(
        new ButtonBuilder().setCustomId(`map_vote_${matchNumber}_BW`).setLabel('BW').setStyle(ButtonStyle.Secondary),
        new ButtonBuilder().setCustomId(`map_vote_${matchNumber}_SB`).setLabel('SB').setStyle(ButtonStyle.Secondary),
        new ButtonBuilder().setCustomId(`map_vote_${matchNumber}_PORT`).setLabel('PORT').setStyle(ButtonStyle.Secondary),
        new ButtonBuilder().setCustomId(`map_vote_${matchNumber}_COMP`).setLabel('COMP').setStyle(ButtonStyle.Secondary),
        new ButtonBuilder().setCustomId(`map_vote_${matchNumber}_ANK`).setLabel('ANK').setStyle(ButtonStyle.Secondary)
      );

    const mapVoteRow2 = new ActionRowBuilder()
      .addComponents(
        new ButtonBuilder().setCustomId(`map_vote_${matchNumber}_MEX`).setLabel('MEX').setStyle(ButtonStyle.Secondary),
        new ButtonBuilder().setCustomId(`map_vote_${matchNumber}_EE`).setLabel('EE').setStyle(ButtonStyle.Secondary)
      );

    const messages = await matchText.messages.fetch({ limit: 10 });
    const matchMessage = messages.find(msg => msg.embeds[0]?.title === `๐ŸŽฎ Match ${matchNumber} ๐ŸŽฎ`);

    if (matchMessage) {
      try {
        await matchMessage.delete();
      } catch (error) {
        console.error(`Failed to delete message: ${error.message}`);
      }
    }

    await matchText.send({ embeds: [embed], components: [...playerPickRows, mapVoteRow1, mapVoteRow2] });
  } catch (error) {
    console.error('Error updating match message:', error);
  }
};

const handlePick = async (interaction) => {
  try {
    const [_, matchNumber, playerId] = interaction.customId.split('_');
    const match = matches[matchNumber];

    if (!match) {
      await interaction.reply({ content: `Match ${matchNumber} not found.`, ephemeral: true });
      return;
    }

    const user = interaction.user;
    const currentPickTeam = match.pickingOrder[match.currentPick];
    const isCaptain = (user.id === match.team1[0] && currentPickTeam === 'team1') || 
                      (user.id === match.team2[0] && currentPickTeam === 'team2');

    if (!isCaptain) {
      await interaction.reply({ content: 'Only the respective captain can pick for their team on their turn.', ephemeral: true });
      return;
    }

    const team = match.pickingOrder[match.currentPick];
    if (!team) {
      await interaction.reply({ content: 'Invalid picking order.', ephemeral: true });
      return;
    }

    match[team].push(playerId);
    match.remaining = match.remaining.filter(id => id !== playerId);
    match.currentPick = (match.currentPick + 1) % match.pickingOrder.length;

    if (match.currentPick === 0 && match.remaining.length === 1) {
      match.team1.push(match.remaining[0]);
      match.remaining = [];
    }

    await updateMatchMessage(matchNumber);
    await interaction.reply({ content: `Player <@${playerId}> has been picked for ${team === 'team1' ? 'Team 1' : 'Team 2'}.`, ephemeral: true });
  } catch (error) {
    console.error('Error handling pick:', error);
    await interaction.reply({ content: 'There was an error handling the pick.', ephemeral: true });
  }
};

const voteMap = async (interaction) => {
  try {
    const [_, matchNumber, map] = interaction.customId.split('_');
    const match = matches[matchNumber];

    if (!match) {
      console.error(`Match ${matchNumber} not found.`);
      await interaction.reply({ content: `Match ${matchNumber} not found.`, ephemeral: true });
      return;
    }

    if (!match.mapVotes) match.mapVotes = {};
    if (!match.mapVotes[map]) match.mapVotes[map] = 0;
    match.mapVotes[map]++;

    if (match.mapVotes[map] >= 7) {  // Adjust the voting threshold as needed
      match.chosenMap = map;

      const matchText = client.channels.cache.find(channel => channel.name === `match-${matchNumber}`);
      const messages = await matchText.messages.fetch({ limit: 10 });
      const matchMessage = messages.find(msg => msg.embeds[0]?.title === `๐ŸŽฎ Match ${matchNumber} ๐ŸŽฎ`);

      if (matchMessage) {
        const embed = EmbedBuilder.from(matchMessage.embeds[0]);
        embed.addFields({ name: 'Chosen Map', value: map });
        await matchMessage.edit({ embeds: [embed] });
      }
      await interaction.reply({ content: `Map has been changed to ${map}`, ephemeral: true });
    } else {
      await interaction.reply({ content: `Your vote for ${map} has been recorded!`, ephemeral: true });
    }

    await updateMatchMessage(matchNumber);
  } catch (error) {
    console.error('Error voting map:', error);
    await interaction.reply({ content: 'There was an error voting for the map.', ephemeral: true });
  }
};

const findUserMatch = (userId) => {
  for (const [id, match] of Object.entries(matches)) {
      if (match.team1.includes(userId) || match.team2.includes(userId) || match.remaining.includes(userId)) {
          return id;
      }
  }
  return null;
};

const reportCommand = async (message, args) => {
  try {
 v
    const matchId = findUserMatch(message.author.id);
    const winningTeamNumber = args[0];

    if (!matchId || !matches[matchId]) {
      return message.reply('You are not in any active match.');
    }

    const match = matches[matchId];
    const team1 = match.team1;
    const team2 = match.team2;
    let winningTeam, losingTeam;

    if (winningTeamNumber === '1') {
      winningTeam = team1;
      losingTeam = team2;
      updateElo(team1, team2);
    } else if (winningTeamNumber === '2') {
      winningTeam = team2;
      losingTeam = team1;
      updateElo(team2, team1);
    } else {
      return message.reply('Invalid winning team.');
    }

    // Delete match channels
    const guild = message.guild;
    const matchCategory = guild.channels.cache.get(process.env.MATCH_CATEGORY_ID);

    const team1Voice = matchCategory.children.cache.find(c => c.name === `Match ${matchId} - Team 1`);
    const team2Voice = matchCategory.children.cache.find(c => c.name === `Match ${matchId} - Team 2`);
    const matchText = matchCategory.children.cache.find(c => c.name === `match-${matchId}`);

    if (team1Voice) await team1Voice.delete();
    if (team2Voice) await team2Voice.delete();
    if (matchText) await matchText.delete();

    delete matches[matchId];
    message.reply(`Match ${matchId} has been reported and the channels have been deleted.`);

    const reporter = message.author;
    logMatch(matchId, winningTeam, losingTeam, `Team ${winningTeamNumber}`, reporter);
  } catch (error) {
    console.error('Error reporting match:', error);
    message.reply('There was an error reporting the match.');
  }
};

const clearQueueCommand = async (message) => {
  try {
    queue = [];
    await updateQueueMessage();
    message.reply('The queue has been cleared.');
  } catch (error) {
    console.error('Error clearing queue:', error);
    message.reply('There was an error clearing the queue.');
  }
};

const resetEloCommand = async (message) => {
  try {
    if (message.member.permissions.has(PermissionsBitField.Flags.Administrator)) {
      playersELO = {};
      saveData();
      message.reply('All ELO has been reset.');
    } else {
      message.reply('You do not have permission to use this command.');
    }
  } catch (error) {
    console.error('Error resetting ELO:', error);
    message.reply('There was an error resetting the ELO.');
  }
};

const giveEloCommand = async (message, args) => {
  try {
    if (message.member.permissions.has(PermissionsBitField.Flags.Administrator)) {
      const [userId, elo] = args;
      if (!playersELO[userId]) playersELO[userId] = 0;
      playersELO[userId] += parseInt(elo, 10);
      saveData();
      message.reply(`ELO given to <@${userId}>.`);
    } else {
      message.reply('You do not have permission to use this command.');
    }
  } catch (error) {
    console.error('Error giving ELO:', error);
    message.reply('There was an error giving the ELO.');
  }
};

const setMatchLogChannelCommand = async (message, args) => {
  try {
    const channelId = args[0];
    if (message.member.permissions.has(PermissionsBitField.Flags.Administrator)) {
      process.env.MATCH_LOG_CHANNEL_ID = channelId;
      message.reply('Match log channel set.');
    } else {
      message.reply('You do not have permission to use this command.');
    }
  } catch (error) {
    console.error('Error setting match log channel:', error);
    message.reply('There was an error setting the match log channel.');
  }
};
const warnCommand = async (message, args) => {
  try {
    // Check if the user has the administrator permission
    if (!message.member.permissions.has(PermissionsBitField.Flags.Administrator)) {
      return message.reply('You do not have permission to use this command.');
    }

    // Check if a user is mentioned and extract the user ID
    if (!args[0] || !args[0].match(/^<@!?(\d+)>$/)) {
      return message.reply('Please mention a valid user to warn.');
    }

    const userId = args[0].replace('<@', '').replace('>', '');
    const reason = args.slice(1).join(' ') || 'No reason provided';

    // Initialize warnings if the user has none
    if (!playerWarnings[userId]) {
      playerWarnings[userId] = { count: 0, reasons: [] };
    }

    // Increment the warning count and add the reason
    playerWarnings[userId].count += 1;
    playerWarnings[userId].reasons.push(reason);
    saveData();

    const embed = new EmbedBuilder()
      .setColor('#ff4500') // Orange-red color suitable for a competitive FPS theme
      .setTitle('User Warned')
      .addFields(
        { name: 'User', value: `<@${userId}>`, inline: true },
        { name: 'Warnings', value: playerWarnings[userId].count.toString(), inline: true },
        { name: 'Reason', value: reason, inline: true }
      )
      .setThumbnail('https://i.imgur.com/wTF3RuJ.png') // Placeholder thumbnail, replace with relevant image
      .setFooter({ text: 'Stay in line, soldier!', iconURL: 'https://i.imgur.com/wTF3RuJ.png' })
      .setTimestamp();

    message.reply({ embeds: [embed] });
  } catch (error) {
    console.error('Error warning user:', error);
    message.reply('There was an error warning the user.');
  }
};

const warnsCommand = async (message, args) => {
  try {
    const userId = args[0] ? args[0].replace('<@', '').replace('>', '') : message.author.id;
    const userWarnings = playerWarnings[userId] ? playerWarnings[userId].count : 0;
    const reasons = playerWarnings[userId] ? playerWarnings[userId].reasons : [];
    const username = message.mentions.users.first() ? message.mentions.users.first().username : message.author.username;

    const embed = new EmbedBuilder()
      .setColor('#ff4500') // Orange-red color suitable for a competitive FPS theme
      .setTitle(`${username}'s Warnings`)
      .addFields(
        { name: 'Warnings', value: userWarnings.toString(), inline: true },
        { name: 'Reasons', value: reasons.length > 0 ? reasons.join('\n') : 'No warnings', inline: true }
      )
      .setThumbnail('https://i.imgur.com/wTF3RuJ.png') // Placeholder thumbnail, replace with relevant image
      .setFooter({ text: 'Stay in line, soldier!', iconURL: 'https://i.imgur.com/wTF3RuJ.png' })
      .setTimestamp();

    message.reply({ embeds: [embed] });
  } catch (error) {
    console.error('Error fetching warnings:', error);
    message.reply('There was an error fetching the warnings.');
  }
};

const profileCommand = async (message, args) => {
  const userId = args[0] ? args[0].replace('<@', '').replace('>', '') : message.author.id;
  const username = message.mentions.users.first() ? message.mentions.users.first().username : message.author.username;
  const elo = playersELO[userId] || 0;
  const userKarma = karma[userId] || 0;
  const stats = playerStats[userId] || {};

  // Default map stats if not present
  const defaultMapStats = { wins: 0, losses: 0 };
  const maps = {
    BW: stats.BW || defaultMapStats,
    PORT: stats.PORT || defaultMapStats,
    ANK: stats.ANK || defaultMapStats,
    COMP: stats.COMP || defaultMapStats,
    SB: stats.SB || defaultMapStats,
    MEX: stats.MEX || defaultMapStats,
    EE: stats.EE || defaultMapStats
  };

  // Calculate total wins and losses
  const totalWins = Object.values(maps).reduce((acc, map) => acc + map.wins, 0);
  const totalLosses = Object.values(maps).reduce((acc, map) => acc + map.losses, 0);

  // Create embed message
  const embed = new EmbedBuilder()
    .setTitle(`${username}'s Profile`)
    .addFields(
      { name: 'ELO', value: elo.toString(), inline: true },
      { name: 'Karma', value: userKarma.toString(), inline: true },
      { name: '\u200B', value: '\u200B', inline: true }
    )
    .addFields(
      { name: 'Map Stats:', value: '\u200B' },
      { name: 'Black Widow', value: `${maps.BW.wins} wins ${maps.BW.losses} losses`, inline: true },
      { name: 'Port', value: `${maps.PORT.wins} wins ${maps.PORT.losses} losses`, inline: true },
      { name: 'Ankara', value: `${maps.ANK.wins} wins ${maps.ANK.losses} losses`, inline: true },
      { name: 'Compound', value: `${maps.COMP.wins} wins ${maps.COMP.losses} losses`, inline: true },
      { name: 'Sub Base', value: `${maps.SB.wins} wins ${maps.SB.losses} losses`, inline: true },
      { name: 'Mexico', value: `${maps.MEX.wins} wins ${maps.MEX.losses} losses`, inline: true },
      { name: 'Eagle Eye', value: `${maps.EE.wins} wins ${maps.EE.losses} losses`, inline: true },
      { name: 'Total Wins', value: totalWins.toString(), inline: true },
      { name: 'Total Losses', value: totalLosses.toString(), inline: true }
    );

  message.reply({ embeds: [embed] });
};

const leaderboardCommand = async (message) => {
  try {
    const sortedPlayers = Object.entries(playersELO).sort((a, b) => b[1] - a[1]).slice(0, 25);
    const leaderboard = await Promise.all(
      sortedPlayers.map(async ([userId, elo], index) => {
        const user = await message.guild.members.fetch(userId).catch(() => null);
        return `#${index + 1}  |  ${elo}  |  ${user ? `<@${user.id}>` : `Unknown User`}`;
      })
    );

    if (leaderboard.length === 0) {
      leaderboard.push('No players available');
    }

    const embed = new EmbedBuilder()
      .setColor('#00ff26') // Set a custom color for the embed
      .setTitle('Top 25 Pug Players')
      .addFields({ name: 'Rank | Elo | Player', value: leaderboard.join('\n') })
      .setFooter({ text: 'Use .lb or .leaderboard to see the leaderboard at any time', iconURL: 'https://i.imgur.com/wTF3RuJ.png' })
      .setTimestamp();

    message.reply({ embeds: [embed] });
  } catch (error) {
    console.error('Error fetching leaderboard:', error);
    message.reply('There was an error fetching the leaderboard.');
  }
};




const eloCommand = async (message, args) => {
  try {
    const userId = args[0] ? args[0].replace('<@', '').replace('>', '') : message.author.id;
    const elo = playersELO[userId] || 0;
    message.reply(`<@${userId}> has ${elo} ELO.`);
  } catch (error) {
    console.error('Error fetching ELO:', error);
    message.reply('There was an error fetching the ELO.');
  }
};

const pickCommand = async (message, args) => {
  try {
    if (!args[0] || !args[0].match(/^<@!?(\d+)>$/)) {
      return message.reply('Please mention a valid user to pick.');
    }

    const playerId = args[0].replace('<@', '').replace('>', '');
    const userId = message.author.id;
    const matchId = findUserMatch(userId);

    if (!matchId) {
      return message.reply('You are not part of any active matches.');
    }

    const match = matches[matchId];
    const currentPickIndex = match.team1.length + match.team2.length - 2;

    if (currentPickIndex >= match.pickingOrder.length) {
      return message.reply('All picks have already been made.');
    }

    const pickingTeam = match.pickingOrder[currentPickIndex] === 'team1' ? 'team1' : 'team2';

    if (!match.remaining.includes(playerId)) {
      return message.reply('Invalid player ID for picking.');
    }

    match[pickingTeam].push(playerId);
    match.remaining = match.remaining.filter(id => id !== playerId);

    await updateMatchMessage(matchId);

    message.reply(`Player <@${playerId}> picked for ${pickingTeam === 'team1' ? 'Team 1' : 'Team 2'}.`);
  } catch (error) {
    console.error('Error picking player:', error);
    message.reply('There was an error picking the player.');
  }
};

const needSubCommand = async (message, args) => {
  try {
    if (!args[0] || !args[0].match(/^<@!?(\d+)>$/)) {
      return message.reply('Please mention a valid user to sub.');
    }

    const userId = message.author.id;
    const playerId = args[0].replace('<@', '').replace('>', '');
    const matchId = findUserMatch(userId);

    if (!matchId) {
      return message.reply('You are not part of any active matches.');
    }

    const match = matches[matchId];
    const team = match.team1.includes(playerId) ? 'team1' : 'team2';
    const playerIndex = match[team].indexOf(playerId);

    if (playerIndex === -1) {
      return message.reply('Player not found in any team.');
    }

    const subMessage = await message.channel.send(`<@${playerId}> has requested a substitution. React with โŒ within 2 minutes if you are still here.`);
    await subMessage.react('โŒ');

    const filter = (reaction, user) => reaction.emoji.name === 'โŒ' && user.id === playerId;
    const collector = subMessage.createReactionCollector({ filter, time: 120000 });

    collector.on('collect', () => {
      subMessage.edit(`<@${playerId}> is still active.`);
      collector.stop();
    });

    collector.on('end', async collected => {
      if (collected.size === 0) {
        const newPlayerId = queue.shift();
        if (!newPlayerId) {
          return message.channel.send('No available substitutes in the queue.');
        }

        match[team][playerIndex] = newPlayerId;
        await updateMatchMessage(matchId);

        message.channel.send(`<@${playerId}> has been substituted by <@${newPlayerId}> in ${team === 'team1' ? 'Team 1' : 'Team 2'}.`);
      }
    });
  } catch (error) {
    console.error('Error handling substitution:', error);
    message.reply('There was an error handling the substitution.');
  }
};


const replaceCommand = async (message, args) => {
  try {
    if (args.length < 2 || !args[0].match(/^<@!?(\d+)>$/) || !args[1].match(/^<@!?(\d+)>$/)) {
      return message.reply('Please mention the old player and the new player in the correct format.');
    }

    const oldPlayerId = args[0].replace('<@', '').replace('>', '');
    const newPlayerId = args[1].replace('<@', '').replace('>', '');
    const userId = message.author.id;
    const matchId = findUserMatch(userId);

    if (!matchId) {
      return message.reply('You are not part of any active matches.');
    }

    const match = matches[matchId];
    const team = match.team1.includes(oldPlayerId) ? 'team1' : match.team2.includes(oldPlayerId) ? 'team2' : null;

    if (!team) {
      return message.reply('Old player is not found in any team.');
    }

    const playerIndex = match[team].indexOf(oldPlayerId);

    if (playerIndex === -1) {
      return message.reply('Old player not found in the team.');
    }

    match[team][playerIndex] = newPlayerId;

    await updateMatchMessage(matchId);

    message.reply(`Player <@${oldPlayerId}> has been replaced by <@${newPlayerId}> in ${team === 'team1' ? 'Team 1' : 'Team 2'}.`);
  } catch (error) {
    console.error('Error replacing player:', error);
    message.reply('There was an error replacing the player.');
  }
};


const ptCommand = async (message, args) => {
  try {
    if (args.length < 1) {
      return message.reply('Please specify the team number (1, 2, or 0) and an optional message.');
    }

    const userId = message.author.id;
    const teamNumber = parseInt(args[0]);

    if (isNaN(teamNumber) || (teamNumber < 0 || teamNumber > 2)) {
      return message.reply('Invalid team number. Use 1 for Team 1, 2 for Team 2, or 0 for both teams.');
    }

    const additionalMessage = args.slice(1).join(' ');

    const matchId = findUserMatch(userId);

    if (!matchId) {
      return message.reply('You are not part of any active matches.');
    }

    const match = matches[matchId];
    let teamMentions = '';

    if (teamNumber === 0) {
      const allTeams = [...match.team1, ...match.team2];
      teamMentions = allTeams.map(id => `<@${id}>`).join(' ');
    } else if (teamNumber === 1) {
      teamMentions = match.team1.map(id => `<@${id}>`).join(' ');
    } else if (teamNumber === 2) {
      teamMentions = match.team2.map(id => `<@${id}>`).join(' ');
    }

    const finalMessage = `${teamMentions} ${additionalMessage}`;

    try {
      const matchCategory = await message.client.channels.fetch(process.env.MATCH_CATEGORY_ID);
      const matchText = matchCategory.children.find(c => c.name === `match-${matchId}`);
      if (!matchText) {
        return message.reply('Match text channel not found.');
      }

      await matchText.send(finalMessage);
      message.reply('Message sent.');
    } catch (error) {
      console.error('Error sending message:', error);
      message.reply('There was an error sending the message. Please try again later.');
    }
  } catch (error) {
    console.error('Error in PT command:', error);
    message.reply('There was an error executing the PT command.');
  }
};


const cancelMatchCommand = async (message, args) => {
  try {
    const userId = message.author.id;
    const matchId = findUserMatch(userId);

    if (!matchId) {
      return message.reply('You are not part of any active matches.');
    }

    const match = matches[matchId];
    delete matches[matchId];

    const guild = message.guild;
    const matchCategory = guild.channels.cache.get(process.env.MATCH_CATEGORY_ID);

    const team1Voice = matchCategory.children.find(c => c.name === `Match ${matchId} - Team 1`);
    const team2Voice = matchCategory.children.find(c => c.name === `Match ${matchId} - Team 2`);
    const matchText = matchCategory.children.find(c => c.name === `match-${matchId}`);

    if (team1Voice) await team1Voice.delete();
    if (team2Voice) await team2Voice.delete();
    if (matchText) await matchText.delete();

    message.reply(`Match ${matchId} has been canceled.`);
  } catch (error) {
    console.error('Error canceling match:', error);
    message.reply('There was an error canceling the match.');
  }
};

const suspendUserCommand = async (message, args) => {
  try {
    const userId = args[0].replace('<@', '').replace('>', '');
    const duration = parseInt(args[1]); // Duration in minutes
    const reason = args.slice(2).join(' ');

    if (!karma[userId]) karma[userId] = {};
    karma[userId].suspendedUntil = Date.now() + duration * 60000;
    karma[userId].reason = reason;
    saveData();

    message.reply(`<@${userId}> has been suspended for ${duration} minutes. Reason: ${reason}`);
  } catch (error) {
    console.error('Error suspending user:', error);
    message.reply('There was an error suspending the user.');
  }
};

const unSuspendUserCommand = async (message, args) => {
  try {
    const userId = args[0].replace('<@', '').replace('>', '');

    if (karma[userId] && karma[userId].suspendedUntil) {
      delete karma[userId].suspendedUntil;
      delete karma[userId].reason;
      saveData();
      message.reply(`<@${userId}>'s suspension has been lifted.`);
    } else {
      message.reply(`<@${userId}> is not currently suspended.`);
    }
  } catch (error) {
    console.error('Error unsuspending user:', error);
    message.reply('There was an error lifting the suspension.');
  }
};

const saveData = () => {
  const data = { playersELO, playerWarnings, karma, playerStats };
  fs.writeFileSync(dataFilePath, JSON.stringify(data, null, 2), 'utf-8');
};

const logMatch = (matchId, winningTeam, losingTeam, result, reporter) => {
  const logChannel = client.channels.cache.get(process.env.MATCH_LOG_CHANNEL_ID);

  if (!logChannel) {
    console.error('Match log channel not found');
    return;
  }

  const embed = new EmbedBuilder()
    .setTitle(`Match #${matchId} Log`)
    .setColor('#ff4500') // Orange-red color suitable for a competitive FPS theme
    .addFields(
      { name: 'Winners | Team 1', value: winningTeam.map(id => `<@${id}>`).join(' '), inline: true },
      { name: 'Losers | Team 2', value: losingTeam.map(id => `<@${id}>`).join(' '), inline: true },
      { name: 'Reported by', value: `${reporter.username}#${reporter.discriminator} (${reporter.id})` }
    )
    .setFooter({ text: 'Powered by Maverick', iconURL: 'https://i.imgur.com/wTF3RuJ.png' })
    .setTimestamp();

  logChannel.send({ embeds: [embed] });
};

const updateElo = (winningTeam, losingTeam) => {
  winningTeam.forEach(player => {
    if (!playersELO[player]) playersELO[player] = 50;
    playersELO[player] += 6;
  });

  losingTeam.forEach(player => {
    if (!playersELO[player]) playersELO[player] = 50;
    playersELO[player] -= 5;
  });

  saveData();
};

const registerCommands = () => {
  const commands = [
    {
      name: 'setupreaction',
      description: 'Recreates the reaction message to join the queue',
      type: 1,
    },
    {
      name: 'eloreset',
      description: 'Resets all ELO, must be superuser',
      type: 1,
    },
    {
      name: 'warningreset',
      description: 'Resets all warnings, must be admin',
      type: 1,
    },
    {
      name: 'leaderboard',
      description: 'Leaderboard in the stats channel',
      type: 1,
    }
  ];

  const guild = client.guilds.cache.first();
  guild.commands.set(commands).then(() => console.log('Commands registered'));
};

client.login(process.env.DISCORD_TOKEN);
<div class="page-breadcrumb">
                                        <ul>
                                            <li><a href="https://www.lundbergroofing.com">Home</a></li>
                                            <li>About Us</li>
                                        </ul>
                                    </div>


.page-breadcrumb ul { display: flex; padding: 0px; margin-left: 0px; list-style: none; gap: 16px; }
.page-breadcrumb ul li a { font-size: 14px; color: rgb(161, 161, 161); }
.page-breadcrumb ul li { position: relative; font-size: 14px; font-weight: 600; color: rgb(161, 161, 161); text-transform: uppercase; }
.page-breadcrumb ul li::after { content: ""; width: 13px; height: 1.5px; background: rgb(161, 161, 161); position: absolute; rotate: -74deg; bottom: 9px; right: -14px; }
.page-breadcrumb { border: 1px solid rgb(238, 238, 238); border-radius: 2px; margin-bottom: 16px; padding: 4px 8px; }
.page-breadcrumb ul li:last-child::after { display: none; }
.page-breadcrumb ul li a:hover { color: rgb(126, 44, 33); }
//Controller

using av_motion_api.Data;
using av_motion_api.Models;
using av_motion_api.ViewModels;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;

namespace av_motion_api.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class RewardController : ControllerBase
    {
        private readonly AppDbContext _appDbContext;

        public RewardController(AppDbContext appDbContext)
        {
            _appDbContext = appDbContext;
        }

        [HttpGet]
        [Route("getAllRewardTypes")]
        public async Task<IActionResult> GetAllRewardTypes()
        {
            try
            {
                var rewardTypes = await _appDbContext.Reward_Types.ToListAsync();
                return Ok(rewardTypes);
            }
            catch (Exception)
            {
                return BadRequest();
            }
        }

        [HttpGet]
        [Route("getRewardTypeById/{id}")]
        public async Task<IActionResult> GetRewardTypeById(int id)
        {
            try
            {
                var rewardType = await _appDbContext.Reward_Types.FindAsync(id);

                if (rewardType == null)
                {
                    return NotFound();
                }

                return Ok(rewardType);
            }
            catch (Exception)
            {
                return BadRequest();
            }
        }

        [HttpPost]
        [Route("createRewardType")]
        public async Task<IActionResult> CreateRewardType(RewardTypeViewModel rt)
        {
            try
            {
                var existingRewardType = await _appDbContext.Reward_Types
                    .FirstOrDefaultAsync(r => r.Reward_Type_Name == rt.Reward_Type_Name);

                if (existingRewardType != null)
                {
                    return Conflict(new { message = "Reward type already exists." });
                }


                var rewardType = new Reward_Type
                {
                    Reward_Type_Name = rt.Reward_Type_Name,
                    Reward_Criteria = rt.Reward_Criteria
                    
                };
                _appDbContext.Reward_Types.Add(rewardType);
                await _appDbContext.SaveChangesAsync();

                return CreatedAtAction(nameof(GetRewardTypeById), new { id = rewardType.Reward_Type_ID }, rewardType);
            }
            catch (Exception)
            {
                return BadRequest();
            }
        }

        [HttpPut]
        [Route("updateRewardType/{id}")]
        public async Task<IActionResult> UpdateRewardType(int id, [FromBody] RewardTypeViewModel rt)
        {
            try
            {
                var rewardType = await _appDbContext.Reward_Types.FindAsync(id);

                if(rewardType == null)
                {
                    return NotFound();
                }

                var existingRewardType = await _appDbContext.Reward_Types
                    .FirstOrDefaultAsync(r => r.Reward_Type_Name == rt.Reward_Type_Name && r.Reward_Type_ID != id);

                if (existingRewardType != null)
                {
                    return Conflict(new { message = "Reward type already exists." });
                }

                rewardType.Reward_Type_Name = rt.Reward_Type_Name;
                rewardType.Reward_Criteria = rt.Reward_Criteria;

                _appDbContext.Entry(rewardType).State = EntityState.Modified;
                await _appDbContext.SaveChangesAsync();

                return NoContent();
            }
            catch (Exception)
            {
                return BadRequest();
            }
        }

        [HttpDelete]
        [Route("deleteRewardType/{id}")]
        public async Task<IActionResult> DeleteRewardType(int id)
        {
            try
            {
                var rewardType = await _appDbContext.Reward_Types.FindAsync(id);

                if(rewardType == null)
                {
                    return NotFound();
                }

                _appDbContext.Reward_Types.Remove(rewardType);
                await _appDbContext.SaveChangesAsync();

                return NoContent();
            }
            catch (Exception)
            {
                return BadRequest();
            }
        }



        [HttpGet]
        [Route("getRewardById/{id}")]
        public async Task<IActionResult> GetRewardById(int id)
        {
            try
            {
                var reward = await _appDbContext.Rewards.FindAsync(id);

                if (reward == null)
                {
                    return NotFound();
                }

                return Ok(reward);
            }
            catch (Exception)
            {
                return BadRequest();
            }
        }

        [HttpGet]
        [Route("getAllRewards")]
        public async Task<IActionResult> GetAllRewards()
        {
            try
            {
                var rewards = await _appDbContext.Rewards
                                         .Join(_appDbContext.Reward_Types,
                                               reward => reward.Reward_Type_ID,
                                               rewardType => rewardType.Reward_Type_ID,
                                               (reward, rewardType) => new RewardViewModel
                                               {
                                                   Reward_ID = reward.Reward_ID,
                                                   Reward_Issue_Date = reward.Reward_Issue_Date,
                                                   Reward_Type_Name = rewardType.Reward_Type_Name,
                                                   IsPosted = reward.IsPosted
                                               })
                                         .ToListAsync();
                return Ok(rewards);
            }
            catch (Exception)
            {
                return BadRequest();
            }
        }

        [HttpPost]
        [Route("redeemReward")]
        public async Task<IActionResult> RedeemReward([FromBody] RewardRedeemViewModel request)
        {
            try
            {
                // Fetch the reward by ID
                var reward = await _appDbContext.Reward_Members
                                                .FirstOrDefaultAsync(r => r.Reward_ID == request.RewardId && r.Member_ID == request.MemberId);

                if (reward == null)
                {
                    return NotFound("Reward not found or not eligible for the member.");
                }

                // Check if the reward is already redeemed
                if (reward.IsRedeemed)
                {
                    return BadRequest("Reward is already redeemed.");
                }

                // Mark the reward as redeemed
                reward.IsRedeemed = true;
                _appDbContext.Entry(reward).State = EntityState.Modified;
                await _appDbContext.SaveChangesAsync();

                return Ok(new { Status = "Success", Message = "Reward redeemed successfully!" });
            }
            catch (Exception)
            {
                return BadRequest("An error occurred while redeeming the reward.");
            }
        }

        [HttpPost]
        [Route("setReward")]
        public async Task<IActionResult> SetReward(RewardSetViewModel r)
        {
            try
            {
                var reward = new Reward
                {
                    Reward_Issue_Date = r.Reward_Issue_Date,
                    Reward_Type_ID = r.Reward_Type_ID,
                    IsPosted = r.IsPosted
                };
                _appDbContext.Rewards.Add(reward);
                await _appDbContext.SaveChangesAsync();

                return CreatedAtAction(nameof(GetRewardById), new { id = reward.Reward_ID }, reward);
            }
            catch (Exception)
            {
                return BadRequest();
            }
        }


        [HttpPost]
        [Route("postReward")]
        public async Task<IActionResult> PostReward([FromBody] RewardPostViewModel request)
        {
            try
            {
                // Fetch the reward by ID
                var reward = await _appDbContext.Rewards
                                                .FirstOrDefaultAsync(r => r.Reward_ID == request.RewardId);

                if (reward == null)
                {
                    return NotFound("Reward not found.");
                }

                // Check if the reward is already posted
                if (reward.IsPosted)
                {
                    return BadRequest("Reward is already posted.");
                }

                // Mark the reward as posted
                reward.IsPosted = true;
                _appDbContext.Entry(reward).State = EntityState.Modified;
                await _appDbContext.SaveChangesAsync();

                // Fetch members who qualify for this reward based on the criteria
                var rewardType = await _appDbContext.Reward_Types.FindAsync(reward.Reward_Type_ID);
                var qualifyingMembers = await GetQualifyingMembers(rewardType.Reward_Criteria);

                // Add qualifying members to the Reward_Member table
                foreach (var member in qualifyingMembers)
                {
                    var rewardMember = new Reward_Member
                    {
                        Member_ID = member.Member_ID,
                        Reward_ID = reward.Reward_ID,
                        IsRedeemed = false
                    };
                    _appDbContext.Reward_Members.Add(rewardMember);
                }
                await _appDbContext.SaveChangesAsync();

                return Ok(new { Status = "Success", Message = "Reward posted successfully!" });
            }
            catch (Exception)
            {
                return BadRequest("An error occurred while posting the reward.");
            }
        }

        //Predined Reward Types Methods
        private async Task<List<Member>> GetQualifyingMembers(string criteria)
        {
            var qualifyingMembers = new List<Member>();

            if (criteria == "Completed 10 Bookings in a Month")
            {
                qualifyingMembers = await GetMembersWithBookingsInMonth(10);
            }
            else if (criteria == "Member for Over a Year")
            {
                qualifyingMembers = await GetLoyalMembers();
            }
            else if (criteria == "Made 20 Bookings in Last 3 Months")
            {
                qualifyingMembers = await GetFrequentBookers(20, 3);
            }
            //else if (criteria == "Perfect Attendance for a Month")
            //{
            //    qualifyingMembers = await GetPerfectAttendanceMembers();
            //}
            //else if (criteria == "Consistent Attendance for a Quarter")
            //{
            //    qualifyingMembers = await GetConsistentAttendanceMembers();
            //}

            return qualifyingMembers;
        }

        private async Task<List<Member>> GetMembersWithBookingsInMonth(int bookingCount)
        {
            var oneMonthAgo = DateTime.Now.AddMonths(-1);
            var qualifyingMembers = await _appDbContext.Members
                .Where(m => _appDbContext.Bookings
                    .Where(b => b.Member_ID == m.Member_ID)
                    .Join(_appDbContext.Booking_Time_Slots,
                          b => b.Booking_ID,
                          bts => bts.Booking_ID,
                          (b, bts) => bts.Time_Slot_ID)
                    .Join(_appDbContext.Time_Slots,
                          btsId => btsId,
                          ts => ts.Time_Slot_ID,
                          (btsId, ts) => ts)
                    .Count(ts => ts.Slot_Date >= oneMonthAgo) >= bookingCount)
                .ToListAsync();

            return qualifyingMembers;
        }

        private async Task<List<Member>> GetLoyalMembers()
        {
            var oneYearAgo = DateTime.Now.AddYears(-1);
            var qualifyingMembers = await _appDbContext.Members
                .Join(_appDbContext.Contracts,
                      m => m.Contract_ID,
                      c => c.Contract_ID,
                      (m, c) => new { Member = m, Contract = c })
                .Where(mc => mc.Contract.Subscription_Date <= oneYearAgo)
                .Select(mc => mc.Member)
                .ToListAsync();

            return qualifyingMembers;
        }


        private async Task<List<Member>> GetFrequentBookers(int bookingCount, int months)
        {
            var dateLimit = DateTime.Now.AddMonths(-months);
            var qualifyingMembers = await _appDbContext.Members
                .Where(m => _appDbContext.Bookings
                    .Where(b => b.Member_ID == m.Member_ID)
                    .Join(_appDbContext.Booking_Time_Slots,
                          b => b.Booking_ID,
                          bts => bts.Booking_ID,
                          (b, bts) => bts.Time_Slot_ID)
                    .Join(_appDbContext.Time_Slots,
                          btsId => btsId,
                          ts => ts.Time_Slot_ID,
                          (btsId, ts) => ts)
                    .Count(ts => ts.Slot_Date >= dateLimit) >= bookingCount)
                .ToListAsync();

            return qualifyingMembers;
        }

        //private async Task<List<Member>> GetPerfectAttendanceMembers()
        //{
        //    var startDate = DateTime.Now.AddMonths(-1);
        //    var qualifyingMembers = await _appDbContext.Members
        //        .Where(m => _appDbContext.Attendance_Lists
        //            .Count(a => a.Member_ID == m.Member_ID && a.Slot_Date >= startDate && a.Members_Present > 0) == 30)
        //        .ToListAsync();

        //    return qualifyingMembers;
        //}

        //private async Task<List<Member>> GetConsistentAttendanceMembers()
        //{
        //    var startDate = DateTime.Now.AddMonths(-3);
        //    var qualifyingMembers = await _appDbContext.Members
        //        .Where(m => _appDbContext.Attendance_Lists
        //            .Count(a => a.Member_ID == m.Member_ID && a.Slot_Date >= startDate && a.Members_Present > 0) >= 12)
        //        .ToListAsync();

        //    return qualifyingMembers;
        //}
    }
}
    //Predined Reward Types Methods
    private async Task<List<Member>> GetQualifyingMembers(string criteria)
    {
        var qualifyingMembers = new List<Member>();

        if (criteria == "Completed 10 Bookings in a Month")
        {
            qualifyingMembers = await GetMembersWithBookingsInMonth(10);
        }
        else if (criteria == "Member for Over a Year")
        {
            qualifyingMembers = await GetLoyalMembers();
        }
        else if (criteria == "Made 20 Bookings in Last 3 Months")
        {
            qualifyingMembers = await GetFrequentBookers(20, 3);
        }
        //else if (criteria == "Perfect Attendance for a Month")
        //{
        //    qualifyingMembers = await GetPerfectAttendanceMembers();
        //}
        //else if (criteria == "Consistent Attendance for a Quarter")
        //{
        //    qualifyingMembers = await GetConsistentAttendanceMembers();
        //}

        return qualifyingMembers;
    }

    private async Task<List<Member>> GetMembersWithBookingsInMonth(int bookingCount)
    {
        var oneMonthAgo = DateTime.Now.AddMonths(-1);
        var qualifyingMembers = await _appDbContext.Members
            .Where(m => _appDbContext.Bookings
                .Where(b => b.Member_ID == m.Member_ID)
                .Join(_appDbContext.Booking_Time_Slots,
                      b => b.Booking_ID,
                      bts => bts.Booking_ID,
                      (b, bts) => bts.Time_Slot_ID)
                .Join(_appDbContext.Time_Slots,
                      btsId => btsId,
                      ts => ts.Time_Slot_ID,
                      (btsId, ts) => ts)
                .Count(ts => ts.Slot_Date >= oneMonthAgo) >= bookingCount)
            .ToListAsync();

        return qualifyingMembers;
    }

    private async Task<List<Member>> GetLoyalMembers()
    {
        var oneYearAgo = DateTime.Now.AddYears(-1);
        var qualifyingMembers = await _appDbContext.Members
            .Join(_appDbContext.Contracts,
                  m => m.Contract_ID,
                  c => c.Contract_ID,
                  (m, c) => new { Member = m, Contract = c })
            .Where(mc => mc.Contract.Subscription_Date <= oneYearAgo)
            .Select(mc => mc.Member)
            .ToListAsync();

        return qualifyingMembers;
    }


    private async Task<List<Member>> GetFrequentBookers(int bookingCount, int months)
    {
        var dateLimit = DateTime.Now.AddMonths(-months);
        var qualifyingMembers = await _appDbContext.Members
            .Where(m => _appDbContext.Bookings
                .Where(b => b.Member_ID == m.Member_ID)
                .Join(_appDbContext.Booking_Time_Slots,
                      b => b.Booking_ID,
                      bts => bts.Booking_ID,
                      (b, bts) => bts.Time_Slot_ID)
                .Join(_appDbContext.Time_Slots,
                      btsId => btsId,
                      ts => ts.Time_Slot_ID,
                      (btsId, ts) => ts)
                .Count(ts => ts.Slot_Date >= dateLimit) >= bookingCount)
            .ToListAsync();

        return qualifyingMembers;
    }

    //private async Task<List<Member>> GetPerfectAttendanceMembers()
    //{
    //    var startDate = DateTime.Now.AddMonths(-1);
    //    var qualifyingMembers = await _appDbContext.Members
    //        .Where(m => _appDbContext.Attendance_Lists
    //            .Count(a => a.Member_ID == m.Member_ID && a.Slot_Date >= startDate && a.Members_Present > 0) == 30)
    //        .ToListAsync();

    //    return qualifyingMembers;
    //}

    //private async Task<List<Member>> GetConsistentAttendanceMembers()
    //{
    //    var startDate = DateTime.Now.AddMonths(-3);
    //    var qualifyingMembers = await _appDbContext.Members
    //        .Where(m => _appDbContext.Attendance_Lists
    //            .Count(a => a.Member_ID == m.Member_ID && a.Slot_Date >= startDate && a.Members_Present > 0) >= 12)
    //        .ToListAsync();

    //    return qualifyingMembers;
    //}
}
EMCommonWebAPI  webAPI = EMCommonWebAPI::construct();       
// Prepare the request   
EMWebRequest    webRequest = EMWebRequest::newUrl('https://api.restful-api.dev/objects');
   
// Set the method to use
webRequest.parmMethod('Post');
System.Text.UTF8Encoding encoder;
encoder = new System.Text.UTF8Encoding();

// Initialize the contract to prepare the body
NSHEContract contract = new NSHEContract();
contract.parmName('NShe MacBook Pro 16');
        
NSHEContractData contractData = new  NSHEContractData();
contractData.parmCPUModel('Fast model x');
contractData.parmhardDiskSize('225 GB');
contractData.parmPrice(2000);
contractData.parmYear(2023);
contract.parmData(contractData);

//Convert the data contract to Binary         
System.IO.MemoryStream stream = new System.IO.MemoryStream();
System.Byte[] encodedBytes = encoder.GetBytes(FormJsonSerializer::serializeClass(contract));
stream.Write(encodedBytes, 0, encodedBytes.get_Length());
Binary content = binary::constructFromMemoryStream(stream);
stream.Close();

//Set the body of the request
webRequest.parmContent(content);
webRequest.parmContentType('application/json');

// Get the response by calling the API
EMWebResponse   webresponse = webAPI.getResponse(webRequest);
        
if (webresponse && webresponse.RequestSucceeded())
{
    info ('Succedded');
}
# Analyzing Clicks A Python Function for Extracting Weekly Stats

users_data = [
    {'day': 0, 'clicks': 100}, {'day': 1, 'clicks': 10},
    {'day': 2, 'clicks': 150}, {'day': 3, 'clicks': 1000},
    {'day': 4, 'clicks': 100}, {'day': 5, 'clicks': 190},
    {'day': 6, 'clicks': 150}, {'day': 7, 'clicks': 1000}
]

def get_stats(day):
    # -1 to start from day 0 because day in date is 1
    return users_data[day - 1: day + 7]

print(get_stats(1))
"AccountNumber": "PNJ01",
   "D_VALN_AS_OF": "2022-06-30 00:00:00.0",
     "T_DTL_DESC": "EWTP ARABIA TECHONLOGY INNOVATION FUND ILP",
       "N-INV-SUB-CATG": "Partnerships",
         "Asset Super Category Name": "Venture Capital and Partnerships",
           "A_ADJ_BAS_BSE": "47947573",
             "A_UNRL_MKT_GNLS": "50275681",
               "ProprietarySymbol": "993FD3998",
import sqlite3

# Connect to the database
con = sqlite3.connect('database.db')

# Create a cursor object
cursor = con.cursor()

# Define the data to be inserted as a list of tuples
data = [
    ('John Doe', 'johndoe@example.com'),
    ('Jane Smith', 'janesmith@example.com'),
    ('Mike Johnson', 'mikejohnson@example.com')
]

# Use executemany() to insert the data into the "users" table
cursor.executemany("INSERT INTO users (name, email) VALUES (?, ?)", data)

# Commit the changes
con.commit()
import sqlite3

# Connect to the database
con = sqlite3.connect('database.db')

# Create a cursor object
cursor = con.cursor()

# Update user name based on ID
user_id = 2
new_name = "John Doe"

cursor.execute("UPDATE users SET name = ? WHERE id = ?", (new_name, user_id))

# Commit the changes
con.commit()
import sqlite3

# Connect to the database
con = sqlite3.connect('database.db')

# Create a cursor object
cursor = con.cursor()

# Fetch all data from the "users" table
cursor.execute("SELECT * FROM users")
data = cursor.fetchall()

# Print the retrieved data
for row in data:
    print(row)
import sqlite3

# Connect to the database
con = sqlite3.connect('database.db')

# Create a cursor object
cursor = con.cursor()

# Delete user based on ID
user_id = 123

cursor.execute("DELETE FROM users WHERE id = ?", (user_id,))

# Commit the changes
con.commit()
import sqlite3

# Connect to the database
con = sqlite3.connect('database.db')

# Create a cursor object
cursor = con.cursor()

# Fetch data based on the ID filter
cursor.execute("SELECT * FROM users WHERE id = ?", (123,))
data = cursor.fetchall()

# Print the retrieved data
for row in data:
    print(row)

New-Item -Path WSMan:\localhost\Plugin\TestPlugin\InitializationParameters `
         -ParamName testparametername `
         -ParamValue testparametervalue
import sqlite3

# Connect to the database
con = sqlite3.connect('database.db')

# Create a cursor object
cursor = con.cursor()

# Create a cursor object
cursor = con.cursor()

# Insert a new user
cursor.execute("INSERT INTO users (name, email) VALUES (?, ?)", ("John Doe", "johndoe@example.com"))

# Commit the changes
con.commit()

MyModel::withTrashed()->updateOrCreate([
   'foo' => $foo,
	// ...
], [
   'deleted_at' => null,
	// ...
]);
$this->sizesInterface->withTrashed()->updateOrCreate(
            ['size' => $r->input('size')],
            $r->all())->restore();
$cred = Get-Credential
New-Item -Path WSMan:\localhost\ClientCertificate `
         -Issuer 1b3fd224d66c6413fe20d21e38b304226d192dfe `
         -URI wmicimv2/* `
         -Credential $cred;
$path = "WSMan:\localhost\Plugin\TestPlugin\Resources\Resource_5967683"
New-Item -Path $path\Security `
         -Sddl "O:NSG:BAD:P(A;;GA;;;BA)S:P(AU;FA;GA;;;WD)(AU;SA;GWGX;;;WD)"
New-Item -Path WSMan:\localhost\Plugin\TestPlugin\Resources `
         -ResourceUri http://schemas.dmtf.org/wbem/wscim/3/cim-schema `
         -Capability "Enumerate"

New-Item -Path WSMan:\localhost\Plugin `
         -Plugin TestPlugin `
         -FileName %systemroot%\system32\WsmWmiPl.dll `
         -Resource http://schemas.dmtf.org/wbem/wscim/2/cim-schema `
         -SDKVersion 1 `
         -Capability "Get","Put","Invoke","Enumerate" `
         -XMLRenderingType text
New-Item -Path WSMan:\localhost\Listener -Address * -Transport HTTP -force
// Abstract class Animal

abstract class Animal {

    // Properties

    String name;

    int age;

    // Constructor

    public Animal(String name, int age) {

        this.name = name;

        this.age = age;

    }

    // Abstract method

    public abstract void sound();

    // Method

    public void sleep() {

        System.out.println(name + " is sleeping.");

    }

    // Method to display details of the animal

    public void displayDetails() {

        System.out.println("Name: " + name + ", Age: " + age);

    }

}

// Child class Dog inheriting from Animal

class Dog extends Animal {

    // Additional property

    String breed;

    // Constructor

    public Dog(String name, int age, String breed) {

        // Call to parent class constructor

        super(name, age);

        this.breed = breed;

    }

    // Method overriding

    @Override

    public void sleep() {

        System.out.println(name + " the dog is sleeping.");

    }

    @Override

    public void sound() {

        System.out.println(name + " says Woof!");

    }

    // Additional method specific to Dog

    public void bark() {

        System.out.println(name + " is barking.");

    }

    @Override

    public void displayDetails() {

        super.displayDetails();

        System.out.println("Breed: " + breed);

    }

}

// Child class Cat inheriting from Animal

class Cat extends Animal {

    // Additional property

    String color;

    // Constructor

    public Cat(String name, int age, String color) {

        super(name, age);

        this.color = color;

    }

    // Method overriding

    @Override

    public void sleep() {

        System.out.println(name + " the cat is sleeping.");

    }

    @Override

    public void sound() {

        System.out.println(name + " says Meow!");

    }

    // Additional method specific to Cat

    public void meow() {

        System.out.println(name + " is meowing.");

    }

    @Override

    public void displayDetails() {

        super.displayDetails();

        System.out.println("Color: " + color);

    }

}

// Main class

public class Main {

    public static void main(String[] args) {

        // Create instances of Animal

        Animal[] animals = new Animal[3];

        animals[0] = new Dog("Buddy", 3, "Labrador");

        animals[1] = new Cat("Whiskers", 2, "White");

        animals[2] = new Dog("Rex", 4, "German Shepherd");

        // Display details and demonstrate polymorphism

        for (Animal animal : animals) {

            animal.displayDetails();

            animal.sleep();

            animal.sound();

            System.out.println();

        }

    }

}
function Test-AllConfigFiles
{
    Get-PSSessionConfiguration | ForEach-Object {
        if ($_.ConfigFilePath) {
            $_.ConfigFilePath
            Test-PSSessionConfigurationFile -Verbose -Path $_.ConfigFilePath
        }
    }
}
Test-AllConfigFiles

C:\WINDOWS\System32\WindowsPowerShell\v1.0\SessionConfig\Empty_6fd77bf6-e084-4372-bd8a-af3e207354d3.pssc
True
C:\WINDOWS\System32\WindowsPowerShell\v1.0\SessionConfig\Full_1e9cb265-dae0-4bd3-89a9-8338a47698a1.pssc
VERBOSE: The member 'AliasDefinitions' must contain the required key 'Description'. Add the require key
to the fileC:\WINDOWS\System32\WindowsPowerShell\v1.0\SessionConfig\Full_1e9cb265-dae0-4bd3-89a9-8338a47698a1.pssc.
False
C:\WINDOWS\System32\WindowsPowerShell\v1.0\SessionConfig\NoLanguage_0c115179-ff2a-4f66-a5eb-e56e5692ba22.pssc
True
C:\WINDOWS\System32\WindowsPowerShell\v1.0\SessionConfig\RestrictedLang_b6bd9474-0a6c-4e06-8722-c2c95bb10d3e.pssc
True
C:\WINDOWS\System32\WindowsPowerShell\v1.0\SessionConfig\RRS_3fb29420-2c87-46e5-a402-e21436331efc.pssc
True
Test-PSSessionConfigurationFile -Path (Get-PSSessionConfiguration -Name Restricted).ConfigFilePath
Invoke-Command
Receive-Job
Remove-Job
Resume-Job
Start-Job
Stop-Job
Suspend-Job
Wait-Job
about_Jobs
about_Job_Details
about_Remote_Jobs
about_Scheduled_Jobs
PS> Get-Job

Id     Name            PSJobTypeName   State         HasMoreData     Location             Command
--     ----            -------------   -----         -----------     --------             -------
2      Job2            BackgroundJob   Completed     True            localhost            .\Get-Archive.ps1
4      Job4            RemoteJob       Failed        True            Server01, Server02   .\Get-Archive.ps1
7      UpdateHelpJob   PSScheduledJob  Completed     True            localhost            Update-Help
8      UpdateHelpJob   PSScheduledJob  Completed     True            localhost            Update-Help
9      UpdateHelpJob   PSScheduledJob  Completed     True            localhost            Update-Help
10     UpdateHelpJob   PSScheduledJob  Completed     True            localhost            Update-Help

PS> Get-Job -IncludeChildJob

Id     Name            PSJobTypeName   State         HasMoreData     Location             Command
--     ----            -------------   -----         -----------     --------             -------
2      Job2            BackgroundJob   Completed     True            localhost           .\Get-Archive.ps1
3      Job3                            Completed     True            localhost           .\Get-Archive.ps1
4      Job4            RemoteJob       Failed        True            Server01, Server02  .\Get-Archive.ps1
5      Job5                            Failed        False           Server01            .\Get-Archive.ps1
6      Job6                            Completed     True            Server02            .\Get-Archive.ps1
7      UpdateHelpJob   PSScheduledJob  Completed     True            localhost            Update-Help
8      UpdateHelpJob   PSScheduledJob  Completed     True            localhost            Update-Help
9      UpdateHelpJob   PSScheduledJob  Completed     True            localhost            Update-Help
10     UpdateHelpJob   PSScheduledJob  Completed     True            localhost            Update-Help

PS> Get-Job -Name Job4 -ChildJobState Failed

Id     Name            PSJobTypeName   State         HasMoreData     Location             Command
--     ----            -------------   -----         -----------     --------             -------
2      Job2            BackgroundJob   Completed     True            localhost           .\Get-Archive.ps1
4      Job4            RemoteJob       Failed        True            Server01, Server02  .\Get-Archive.ps1
5      Job5                            Failed        False           Server01            .\Get-Archive.ps1
7      UpdateHelpJob   PSScheduledJob  Completed     True            localhost            Update-Help
8      UpdateHelpJob   PSScheduledJob  Completed     True            localhost            Update-Help
9      UpdateHelpJob   PSScheduledJob  Completed     True            localhost            Update-Help
10     UpdateHelpJob   PSScheduledJob  Completed     True            localhost            Update-Help

PS> (Get-Job -Name Job5).JobStateInfo.Reason

Connecting to remote server Server01 failed with the following error message:
Access is denied.
PS> Workflow WFProcess {Get-Process}
PS> WFProcess -AsJob -JobName WFProcessJob -PSPrivateMetadata @{MyCustomId = 92107}
PS> Get-Job -Filter @{MyCustomId = 92107}
Id     Name            State         HasMoreData     Location             Command
--     ----            -----         -----------     --------             -------
1      WFProcessJob    Completed     True            localhost            WFProcess
PS> Start-Job -ScriptBlock {Get-Process}
Id     Name       PSJobTypeName   State       HasMoreData     Location             Command
--     ----       -------------   -----       -----------     --------             -------
1      Job1       BackgroundJob   Failed      False           localhost            Get-Process

PS> (Get-Job).JobStateInfo | Format-List -Property *
State  : Failed
Reason :

PS> Get-Job | Format-List -Property *
HasMoreData   : False
StatusMessage :
Location      : localhost
Command       : get-process
JobStateInfo  : Failed
Finished      : System.Threading.ManualReset
EventInstanceId    : fb792295-1318-4f5d-8ac8-8a89c5261507
Id            : 1
Name          : Job1
ChildJobs     : {Job2}
Output        : {}
Error         : {}
Progress      : {}
Verbose       : {}
Debug         : {}
Warning       : {}
StateChanged  :

PS> (Get-Job -Name job2).JobStateInfo.Reason
Connecting to remote server using WSManCreateShellEx api failed. The async callback gave the
following error message: Access is denied.
Start-Job -ScriptBlock {Get-EventLog -LogName System}
Invoke-Command -ComputerName S1 -ScriptBlock {Get-EventLog -LogName System} -AsJob
Invoke-Command -ComputerName S2 -ScriptBlock {Start-Job -ScriptBlock {Get-EventLog -LogName System}}
Get-Job

Id     Name       PSJobTypeName   State         HasMoreData     Location        Command
--     ----       -------------   -----         -----------     --------        -------
1      Job1       BackgroundJob   Running       True            localhost       Get-EventLog System
2      Job2       RemoteJob       Running       True            S1              Get-EventLog System

$Session = New-PSSession -ComputerName S2
Invoke-Command -Session $Session -ScriptBlock {Start-Job -ScriptBlock {Get-EventLog -LogName System}}
Invoke-Command -Session $Session -ScriptBlock {Get-Job}

Id     Name            PSJobTypeName   State         HasMoreData     Location             Command                   PSComputerName
--     ----            -------------   -----         -----------     --------             -------                   --------------
1      Job1            BackgroundJob   Running       True            localhost            Get-EventLog -LogName Syโ€ฆ S2
Start-Job -ScriptBlock {Get-Process} -Name MyJob
$j = Get-Job -Name MyJob
$j

Id     Name            PSJobTypeName   State         HasMoreData     Location             Command
--     ----            -------------   -----         -----------     --------             -------
6      MyJob           BackgroundJob   Completed     True            localhost            Get-Process

Receive-Job -Job $j

Handles  NPM(K)    PM(K)      WS(K) VM(M)   CPU(s)     Id ProcessName
-------  ------    -----      ----- -----   ------     -- -----------
    124       4    13572      12080    59            1140 audiodg
    783      16    11428      13636   100             548 CcmExec
     96       4     4252       3764    59            3856 ccmsetup
...
Get-Job -Command "*Get-Process*"

Id     Name            PSJobTypeName   State         HasMoreData     Location             Command
--     ----            -------------   -----         -----------     --------             -------
3      Job3            BackgroundJob   Running       True            localhost            Get-Process
$j = Get-Job -Name Job1
$ID = $j.InstanceID
$ID

Guid
----
03c3232e-1d23-453b-a6f4-ed73c9e29d55

Stop-Job -InstanceId $ID
Get-Job

Id     Name            PSJobTypeName   State         HasMoreData     Location             Command
--     ----            -------------   -----         -----------     --------             -------
1      Job1            BackgroundJob   Completed     True            localhost             $env:COMPUTERNAME
Get-Job
   [-IncludeChildJob]
   [-ChildJobState <JobState>]
   [-HasMoreData <Boolean>]
   [-Before <DateTime>]
   [-After <DateTime>]
   [-Newest <Int32>]
   [-Command <String[]>]
   [<CommonParameters>]
Get-Job
   [-IncludeChildJob]
   [-ChildJobState <JobState>]
   [-HasMoreData <Boolean>]
   [-Before <DateTime>]
   [-After <DateTime>]
   [-Newest <Int32>]
   [-Command <String[]>]
   [<CommonParameters>]
Get-Job
   [-IncludeChildJob]
   [-ChildJobState <JobState>]
   [-HasMoreData <Boolean>]
   [-Before <DateTime>]
   [-After <DateTime>]
   [-Newest <Int32>]
   [[-Id] <Int32[]>]
   [<CommonParameters>]
star

Tue Jul 09 2024 17:11:46 GMT+0000 (Coordinated Universal Time)

@AC3AK1 #javascript

star

Tue Jul 09 2024 17:10:46 GMT+0000 (Coordinated Universal Time)

@AC3AK1 #javascript

star

Tue Jul 09 2024 14:49:40 GMT+0000 (Coordinated Universal Time)

@pvignesh

star

Tue Jul 09 2024 14:44:01 GMT+0000 (Coordinated Universal Time)

@pvignesh

star

Tue Jul 09 2024 14:32:17 GMT+0000 (Coordinated Universal Time)

@pvignesh

star

Tue Jul 09 2024 14:14:58 GMT+0000 (Coordinated Universal Time)

@pvignesh

star

Tue Jul 09 2024 13:18:36 GMT+0000 (Coordinated Universal Time)

@AC3AK1 #javascript

star

Tue Jul 09 2024 13:17:01 GMT+0000 (Coordinated Universal Time)

@AC3AK1 #javascript

star

Tue Jul 09 2024 12:28:47 GMT+0000 (Coordinated Universal Time)

@FRTZ

star

Tue Jul 09 2024 11:49:48 GMT+0000 (Coordinated Universal Time)

@alamin005 #html

star

Tue Jul 09 2024 11:16:14 GMT+0000 (Coordinated Universal Time)

@iamkatmakhafola

star

Tue Jul 09 2024 10:40:26 GMT+0000 (Coordinated Universal Time) https://maticz.com/educational-app-development

@carolinemax ##educational_app_development ##maticz ##usa ##educational_app_development_company

star

Tue Jul 09 2024 10:10:17 GMT+0000 (Coordinated Universal Time)

@iamkatmakhafola

star

Tue Jul 09 2024 09:08:12 GMT+0000 (Coordinated Universal Time)

@Mohamed2210

star

Tue Jul 09 2024 08:43:28 GMT+0000 (Coordinated Universal Time)

@Mohamed2210

star

Tue Jul 09 2024 07:49:34 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-za/powershell/module/microsoft.wsman.management/about/about_wsman_provider?view

@Dewaldt

star

Tue Jul 09 2024 07:31:43 GMT+0000 (Coordinated Universal Time) https://laracasts.com/discuss/channels/eloquent/update-or-create-and-restore-soft-deleted-model

@xsirlalo

star

Tue Jul 09 2024 07:31:28 GMT+0000 (Coordinated Universal Time) https://es.stackoverflow.com/questions/105332/restaurar-soft-delete-laravel

@xsirlalo

star

Tue Jul 09 2024 06:44:59 GMT+0000 (Coordinated Universal Time) https://mdl-e0520a.design.webflow.com/

@Flowr1x

star

Tue Jul 09 2024 06:30:15 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-za/powershell/module/microsoft.wsman.management/about/about_wsman_provider?view

@Dewaldt

star

Tue Jul 09 2024 06:30:00 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-za/powershell/module/microsoft.wsman.management/about/about_wsman_provider?view

@Dewaldt

star

Tue Jul 09 2024 06:29:48 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-za/powershell/module/microsoft.wsman.management/about/about_wsman_provider?view

@Dewaldt

star

Tue Jul 09 2024 06:29:38 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-za/powershell/module/microsoft.wsman.management/about/about_wsman_provider?view

@Dewaldt

star

Tue Jul 09 2024 06:29:26 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-za/powershell/module/microsoft.wsman.management/about/about_wsman_provider?view

@Dewaldt

star

Tue Jul 09 2024 02:59:38 GMT+0000 (Coordinated Universal Time)

@chinnu

star

Tue Jul 09 2024 01:39:45 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-za/powershell/module/microsoft.powershell.core/test-pssessionconfigurationfile?view

@Dewaldt

star

Tue Jul 09 2024 01:39:32 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-za/powershell/module/microsoft.powershell.core/test-pssessionconfigurationfile?view

@Dewaldt

star

Tue Jul 09 2024 01:39:23 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-za/powershell/module/microsoft.powershell.core/test-pssessionconfigurationfile?view

@Dewaldt

star

Tue Jul 09 2024 01:39:05 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-za/powershell/module/microsoft.powershell.core/test-pssessionconfigurationfile?view

@Dewaldt

star

Tue Jul 09 2024 01:38:25 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-za/powershell/module/microsoft.powershell.core/get-job?view

@Dewaldt

star

Tue Jul 09 2024 01:36:57 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-za/powershell/module/microsoft.powershell.core/get-job?view

@Dewaldt

star

Tue Jul 09 2024 01:35:39 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-za/powershell/module/microsoft.powershell.core/get-job?view

@Dewaldt

star

Tue Jul 09 2024 01:35:29 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-za/powershell/module/microsoft.powershell.core/get-job?view

@Dewaldt

star

Tue Jul 09 2024 01:34:50 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-za/powershell/module/microsoft.powershell.core/get-job?view

@Dewaldt

star

Tue Jul 09 2024 01:34:38 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-za/powershell/module/microsoft.powershell.core/get-job?view

@Dewaldt

star

Tue Jul 09 2024 01:34:26 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-za/powershell/module/microsoft.powershell.core/get-job?view

@Dewaldt

star

Tue Jul 09 2024 01:33:35 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-za/powershell/module/microsoft.powershell.core/get-job?view

@Dewaldt

star

Tue Jul 09 2024 01:33:25 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-za/powershell/module/microsoft.powershell.core/get-job?view

@Dewaldt

star

Tue Jul 09 2024 01:33:15 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-za/powershell/module/microsoft.powershell.core/get-job?view

@Dewaldt

star

Tue Jul 09 2024 01:32:42 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-za/powershell/module/microsoft.powershell.core/get-job?view

@Dewaldt

star

Tue Jul 09 2024 01:32:17 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-za/powershell/module/microsoft.powershell.core/get-job?view

@Dewaldt

star

Tue Jul 09 2024 01:32:06 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-za/powershell/module/microsoft.powershell.core/get-job?view

@Dewaldt

Save snippets that work with our extensions

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