Snippets Collections
body {
  display: flex;
  align-items: center;
  flex-direction: column;
  background-color: #2F4F4F; /* Dark Slate Gray */
  margin: 0;
  font-family: 'Nunito', sans-serif;
}

h1 {
  font-family: 'Nunito', sans-serif;
  color: #9932cc; /* Dark orchid */
}

#container {
  height: 200px;
  display: flex;
  align-items: flex-end;
}

.bar {
  width: 25px;
  margin: 1px;
  border-radius: 12px; /* Curved edges */
  background: linear-gradient(180deg, #FF6F61, #FFB347); /* Sunset gradient */
}

#button-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

#control-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 20px; /* Adjust if needed */
}

button {
  padding: 10px 20px;
  font-size: 16px;
  background-color: #9932cc; /* Dark orchid */
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.3s;
}

button:hover {
  background-color: #ba55d3; /* Orchid */
}

.control-button {
  background-color: #FF6347; /* Tomato color */
}

.control-button:hover {
  background-color: #FF7F50; /* Coral color */
}
const n = 20;
const array = [];
let audioCtx = null;
let animationTimeout = null; // to hold the timeout ID for animation

function playNote(freq) {
  if (audioCtx === null) {
    audioCtx = new (AudioContext || webkitAudioContext || window.webkitAudioContext)();
  }

  const dur = 0.1;
  const osc = audioCtx.createOscillator();
  osc.frequency.value = freq;
  osc.start();
  osc.stop(audioCtx.currentTime + dur);

  const node = audioCtx.createGain();
  node.gain.value = 0.1;
  node.gain.linearRampToValueAtTime(0, audioCtx.currentTime + dur);
  osc.connect(node);
  node.connect(audioCtx.destination);
}

function init() {
  for (let i = 0; i < n; i++) {
    array[i] = Math.random();
  }
  showBars();
}

function showBars(move) {
  const container = document.getElementById('container');
  container.innerHTML = '';
  for (let i = 0; i < array.length; i++) {
    const bar = document.createElement('div');
    bar.style.height = array[i] * 100 + '%';
    bar.classList.add('bar');

    if (move && move.indices.includes(i)) {
      bar.style.backgroundColor = move.type === 'swap' ? '#BA55D0' : '#CBC3E3';
    }

    container.appendChild(bar);
  }
}

function createSortingButton(sortName, sortFunction) {
  const button = document.createElement('button');
  button.textContent = sortName;
  button.classList.add('sort-button');
  button.addEventListener('click', () => {
    array.length = 0;
    init();
    const copy = [...array];
    const moves = sortFunction(copy);
    animate(moves);
  });
  return button;
}

function animate(moves) {
  if (moves.length === 0) {
    showBars();
    return;
  }

  const move = moves.shift();
  const [i, j] = move.indices;

  if (move.type === 'swap') {
    [array[i], array[j]] = [array[j], array[i]];
    playNote(300 + array[i] * 500);
    playNote(300 + array[j] * 500);
  } else if (move.type === 'comp') {
    playNote(200 + array[i] * 200);
    playNote(200 + array[j] * 200);
  }

  showBars(move);
  animationTimeout = setTimeout(() => animate(moves), 200);
}

function bubbleSort(array) {
  const moves = [];
  do {
    var swapped = false;
    for (let i = 1; i < array.length; i++) {
      moves.push({ indices: [i - 1, i], type: 'comp' });
      if (array[i - 1] > array[i]) {
        swapped = true;
        moves.push({ indices: [i - 1, i], type: 'swap' });
        [array[i - 1], array[i]] = [array[i], array[i - 1]];
      }
    }
  } while (swapped);
  return moves;
}

function selectionSort(array) {
  const moves = [];
  for (let i = 0; i < array.length - 1; i++) {
    let minIndex = i;
    for (let j = i + 1; j < array.length; j++) {
      moves.push({ indices: [minIndex, j], type: 'comp' });
      if (array[j] < array[minIndex]) {
        minIndex = j;
      }
    }
    if (minIndex !== i) {
      moves.push({ indices: [i, minIndex], type: 'swap' });
      [array[i], array[minIndex]] = [array[minIndex], array[i]];
    }
  }
  return moves;
}

function insertionSort(array) {
  const moves = [];
  for (let i = 1; i < array.length; i++) {
    let key = array[i];
    let j = i - 1;
    while (j >= 0 && array[j] > key) {
      moves.push({ indices: [j, j + 1], type: 'comp' });
      array[j + 1] = array[j];
      j--;
    }
    moves.push({ indices: [j + 1, j + 1], type: 'swap' });
    array[j + 1] = key;
  }
  return moves;
}

function merge(left, right, moves) {
  let result = [];
  let i = 0, j = 0;

  while (i < left.length && j < right.length) {
    moves.push({ indices: [left[i], right[j]], type: 'comp' });
    if (left[i] <= right[j]) {
      result.push(left[i]);
      i++;
    } else {
      result.push(right[j]);
      j++;
    }
  }

  return result.concat(left.slice(i)).concat(right.slice(j));
}

function mergeSort(array) {
  const moves = [];

  const mergeSortHelper = (array) => {
    if (array.length <= 1) {
      return array;
    }

    const middle = Math.floor(array.length / 2);
    const left = array.slice(0, middle);
    const right = array.slice(middle);

    return merge(mergeSortHelper(left), mergeSortHelper(right), moves);
  };

  mergeSortHelper(array);
  return moves;
}

function partition(array, low, high, moves) {
  const pivot = array[high];
  let i = low - 1;

  for (let j = low; j < high; j++) {
    moves.push({ indices: [array[j], pivot], type: 'comp' });
    if (array[j] < pivot) {
      i++;
      moves.push({ indices: [array[i], array[j]], type: 'swap' });
      [array[i], array[j]] = [array[j], array[i]];
    }
  }

  moves.push({ indices: [array[i + 1], pivot], type: 'swap' });
  [array[i + 1], array[high]] = [array[high], array[i + 1]];
  return i + 1;
}

function quickSort(array) {
  const moves = [];

  const quickSortHelper = (array, low, high) => {
    if (low < high) {
      const pi = partition(array, low, high, moves);

      quickSortHelper(array, low, pi - 1);
      quickSortHelper(array, pi + 1, high);
    }
  };

  quickSortHelper(array, 0, array.length - 1);
  return moves;
}

// Stop animation function
function stopAnimation() {
  clearTimeout(animationTimeout); // Stop the current animation timeout
}

// Reset animation function
function resetAnimation() {
  stopAnimation(); // Stop the current animation
  init(); // Re-initialize the array and display bars
}

// Add more sorting algorithms as needed

const buttonContainer = document.getElementById('button-container');

// Create and append Stop and Reset buttons
const stopButton = document.createElement('button');
stopButton.textContent = 'Stop';
stopButton.classList.add('control-button');
stopButton.addEventListener('click', stopAnimation);

const resetButton = document.createElement('button');
resetButton.textContent = 'Reset';
resetButton.classList.add('control-button');
resetButton.addEventListener('click', resetAnimation);

buttonContainer.appendChild(stopButton);
buttonContainer.appendChild(resetButton);

// Add a line break to separate control buttons from sorting buttons
const lineBreak = document.createElement('br');
buttonContainer.appendChild(lineBreak);

// Append sorting buttons
buttonContainer.appendChild(createSortingButton('Bubble Sort', bubbleSort));
buttonContainer.appendChild(createSortingButton('Selection Sort', selectionSort));
buttonContainer.appendChild(createSortingButton('Insertion Sort', insertionSort));
buttonContainer.appendChild(createSortingButton('Merge Sort', mergeSort));
buttonContainer.appendChild(createSortingButton('Quick Sort', quickSort));

init();
const n = 20;
const array = [];
let audioCtx = null;
let animationTimeout = null; // to hold the timeout ID for animation

function playNote(freq) {
  if (audioCtx === null) {
    audioCtx = new (AudioContext || webkitAudioContext || window.webkitAudioContext)();
  }

  const dur = 0.1;
  const osc = audioCtx.createOscillator();
  osc.frequency.value = freq;
  osc.start();
  osc.stop(audioCtx.currentTime + dur);

  const node = audioCtx.createGain();
  node.gain.value = 0.1;
  node.gain.linearRampToValueAtTime(0, audioCtx.currentTime + dur);
  osc.connect(node);
  node.connect(audioCtx.destination);
}

function init() {
  for (let i = 0; i < n; i++) {
    array[i] = Math.random();
  }
  showBars();
}

function showBars(move) {
  const container = document.getElementById('container');
  container.innerHTML = '';
  for (let i = 0; i < array.length; i++) {
    const bar = document.createElement('div');
    bar.style.height = array[i] * 100 + '%';
    bar.classList.add('bar');

    if (move && move.indices.includes(i)) {
      bar.style.backgroundColor = move.type === 'swap' ? '#BA55D0' : '#CBC3E3';
    }

    container.appendChild(bar);
  }
}

function createSortingButton(sortName, sortFunction) {
  const button = document.createElement('button');
  button.textContent = sortName;
  button.classList.add('sort-button');
  button.addEventListener('click', () => {
    array.length = 0;
    init();
    const copy = [...array];
    const moves = sortFunction(copy);
    animate(moves);
  });
  return button;
}

function animate(moves) {
  if (moves.length === 0) {
    showBars();
    return;
  }

  const move = moves.shift();
  const [i, j] = move.indices;

  if (move.type === 'swap') {
    [array[i], array[j]] = [array[j], array[i]];
    playNote(300 + array[i] * 500);
    playNote(300 + array[j] * 500);
  } else if (move.type === 'comp') {
    playNote(200 + array[i] * 200);
    playNote(200 + array[j] * 200);
  }

  showBars(move);
  animationTimeout = setTimeout(() => animate(moves), 200);
}

function bubbleSort(array) {
  const moves = [];
  do {
    var swapped = false;
    for (let i = 1; i < array.length; i++) {
      moves.push({ indices: [i - 1, i], type: 'comp' });
      if (array[i - 1] > array[i]) {
        swapped = true;
        moves.push({ indices: [i - 1, i], type: 'swap' });
        [array[i - 1], array[i]] = [array[i], array[i - 1]];
      }
    }
  } while (swapped);
  return moves;
}

function selectionSort(array) {
  const moves = [];
  for (let i = 0; i < array.length - 1; i++) {
    let minIndex = i;
    for (let j = i + 1; j < array.length; j++) {
      moves.push({ indices: [minIndex, j], type: 'comp' });
      if (array[j] < array[minIndex]) {
        minIndex = j;
      }
    }
    if (minIndex !== i) {
      moves.push({ indices: [i, minIndex], type: 'swap' });
      [array[i], array[minIndex]] = [array[minIndex], array[i]];
    }
  }
  return moves;
}

function insertionSort(array) {
  const moves = [];
  for (let i = 1; i < array.length; i++) {
    let key = array[i];
    let j = i - 1;
    while (j >= 0 && array[j] > key) {
      moves.push({ indices: [j, j + 1], type: 'comp' });
      array[j + 1] = array[j];
      j--;
    }
    moves.push({ indices: [j + 1, j + 1], type: 'swap' });
    array[j + 1] = key;
  }
  return moves;
}

function merge(left, right, moves) {
  let result = [];
  let i = 0, j = 0;

  while (i < left.length && j < right.length) {
    moves.push({ indices: [left[i], right[j]], type: 'comp' });
    if (left[i] <= right[j]) {
      result.push(left[i]);
      i++;
    } else {
      result.push(right[j]);
      j++;
    }
  }

  return result.concat(left.slice(i)).concat(right.slice(j));
}

function mergeSort(array) {
  const moves = [];

  const mergeSortHelper = (array) => {
    if (array.length <= 1) {
      return array;
    }

    const middle = Math.floor(array.length / 2);
    const left = array.slice(0, middle);
    const right = array.slice(middle);

    return merge(mergeSortHelper(left), mergeSortHelper(right), moves);
  };

  mergeSortHelper(array);
  return moves;
}

function partition(array, low, high, moves) {
  const pivot = array[high];
  let i = low - 1;

  for (let j = low; j < high; j++) {
    moves.push({ indices: [array[j], pivot], type: 'comp' });
    if (array[j] < pivot) {
      i++;
      moves.push({ indices: [array[i], array[j]], type: 'swap' });
      [array[i], array[j]] = [array[j], array[i]];
    }
  }

  moves.push({ indices: [array[i + 1], pivot], type: 'swap' });
  [array[i + 1], array[high]] = [array[high], array[i + 1]];
  return i + 1;
}

function quickSort(array) {
  const moves = [];

  const quickSortHelper = (array, low, high) => {
    if (low < high) {
      const pi = partition(array, low, high, moves);

      quickSortHelper(array, low, pi - 1);
      quickSortHelper(array, pi + 1, high);
    }
  };

  quickSortHelper(array, 0, array.length - 1);
  return moves;
}

// Stop animation function
function stopAnimation() {
  clearTimeout(animationTimeout); // Stop the current animation timeout
}

// Reset animation function
function resetAnimation() {
  stopAnimation(); // Stop the current animation
  init(); // Re-initialize the array and display bars
}

// Add more sorting algorithms as needed

const buttonContainer = document.getElementById('button-container');

// Create and append Stop and Reset buttons
const stopButton = document.createElement('button');
stopButton.textContent = 'Stop';
stopButton.classList.add('control-button');
stopButton.addEventListener('click', stopAnimation);

const resetButton = document.createElement('button');
resetButton.textContent = 'Reset';
resetButton.classList.add('control-button');
resetButton.addEventListener('click', resetAnimation);

buttonContainer.appendChild(stopButton);
buttonContainer.appendChild(resetButton);

// Add a line break to separate control buttons from sorting buttons
const lineBreak = document.createElement('br');
buttonContainer.appendChild(lineBreak);

// Append sorting buttons
buttonContainer.appendChild(createSortingButton('Bubble Sort', bubbleSort));
buttonContainer.appendChild(createSortingButton('Selection Sort', selectionSort));
buttonContainer.appendChild(createSortingButton('Insertion Sort', insertionSort));
buttonContainer.appendChild(createSortingButton('Merge Sort', mergeSort));
buttonContainer.appendChild(createSortingButton('Quick Sort', quickSort));

init();
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Sorting Visualizer</title>
  <link href="https://fonts.googleapis.com/css2?family=Nunito:wght@700&display=swap" rel="stylesheet">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <h1>🎶 Sorting Visualizer 🎶</h1>
  <div id="container"></div>

  <hr>

  <div id="button-container">
    <div id="control-buttons">
      <button class="control-button">Stop</button>
      <button class="control-button">Reset</button>
    </div>
    <button>Button 1</button>
    <button>Button 2</button>
    <button>Button 3</button>
    <button>Button 4</button>
  </div>

  <script src="script.js"></script>
</body>
</html>
selector > div {
    padding: 20px;
    border: 1px solid white;
    margin: 0;
}

selector {
    padding: 10px!important;
    background-color: #3b5346;
    display: flex;
    flex-direction: column;
    align-items: normal;
    justify-content: stretch;
    border-radius: 2em 2em 2em 2em;
    margin-top: 20px;
}
selector:hover {
	background-color: #0c0d0e;
}
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":newspaper:  STAY IN THE KNOW  :newspaper:"
			}
		},
		{
			"type": "context",
			"elements": [
				{
					"text": "*August 1, 2024*  |  Office Announcements",
					"type": "mrkdwn"
				}
			]
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Stay in the loop about what's happening at the office such as upcoming visitors, onsite meetings, lunches, and more. Don't miss out- check out the <https://calendar.google.com/calendar/u/0?cid=Y19jNmI2NzM1OTU0NDA0NzE1NWE3N2ExNmE5NjBlOWZkNTgxN2Y1MmQ3NjgyYmRmZmVlMjU4MmQwZDgyMGRiNzMyQGdyb3VwLmNhbGVuZGFyLmdvb2dsZS5jb20|*Tor Happenings Calendar*>"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":calendar: | :breakfast: *TUESDAY BREAKFAST SCHEDULE* :breakfast: | :calendar: "
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "`8/6` *Greenbox*"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "`8/13` *Impact Kitchen*"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "`8/20` *Egg Club*"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "`8/27` *Neon Commissary*"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":calendar: |:lunch: *THURSDAY LUNCH SCHEDULE* :lunch: | :calendar: "
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "`8/1` *Chiang Mai* _Thai_"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "`8/8` *Pie Commission*"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "`8/15` *Impact Kitchen* _Salad Bowls_"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "`8/22` *Scotty Bons* _Caribbean_"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "`8/29` *Black Camel* _Sandwiches_"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":loud_sound:*FOR YOUR INFORMATION* :loud_sound:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":coffee: *Every Tuesday and Thursday*: Enjoy coffee and café-style beverages from our partner, *HotBlack Coffee*, located at *245 Queen St W*, by showing your *Xero ID* \n\n:holiday-potato: *Upcoming Public Holiday*: Monday, 5th August \n\n:OFFICE: *Self-Serviced Fridays* _WX will still be online and working, just not onsite_. For more information, check out our <https://docs.google.com/document/d/1yPfsoOt4o-_scOmAGtYuZduzW_8333id2w5dhrlnVz0/edit| *FAQ page*> or reach out to WX. \n\n :standup: *Canada Stand Up* \n *August 15th*- Hosted by Intern Engineer, *Daniel Iseoluwa* \n\n:blob-party: *Monthly Social* \n*August 29th @ 3:30pm*"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":WX: *WX offers comprehensive event planning services, including:*\n - Assistance with logistics and coordination \n - Access to a network of vendors for catering, supply ordering, etc.\n\n _Note: Even if you don’t need our assistance but are using the office space, kindly inform WX._ "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":tada: *Happy Birthday* :tada: to all Xeros celebrating their birthdays this August! We hope you have an amazing day :party_wiggle: "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "context",
			"elements": [
				{
					"type": "mrkdwn",
					"text": ":pushpin: Have something important to add to our calendar or need some assistance? Get in touch with us by logging a ticket via the <https://xerohelp.zendesk.com/hc/en-us/requests/new?ticket_form_id=900001672246| *HelpCentre*>. We are here to help!"
				}
			]
		},
		{
			"type": "divider"
		}
	]
}
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinHttpAutoProxySvc. In the value "start", change the data value from "3" to "4".
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Leaf Classifier</title>
    <link rel="stylesheet" href="styles.css">
</head>
<body>
    <div class="container">
        <h1>Leaf Classifier</h1>
        <input type="file" id="leafImage" accept="image/*">
        <button id="classifyButton">Classify Leaf</button>
        <div id="resultContainer"></div>
    </div>
    <script src="script.js"></script>
</body>
</html>
add_action('wp_head', 'skip_link_fix');
function skip_link_fix() {
	?>
  <script>
  window.addEventListener( 'elementor/frontend/init', function() {
  if ( typeof elementorFrontend === 'undefined' ) {
  return;
  }
 
  elementorFrontend.on( 'components:init', function() {
  elementorFrontend.utils.anchors.setSettings('selectors',{});
  } );
  } );
  </script>
<?php
}
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":star: Boost Day is Here! :star:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Hey Toronto! \n\nIt's Boost Day!\n\nCheck out today's fantastic lineup: "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-30: Tuesday, 30th July",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Café Partnership*: Enjoy coffee and café-style beverages from our partner, *HotBlack Coffee*, located at 245 Queen St W, by showing your *Xero ID*.\n:breakfast: *Breakfast*: Provided by *Pico de Gallo* at *9AM - 10AM* in the Kitchen."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "plain_text",
				"text": "Have an amazing Boost Day, Toronto!\n\nLove,\n\nWX  :party-wx:  ",
				"emoji": true
			}
		}
	]
}
public static class JSONSerializer<TType> where TType : class
{
    /// <summary>
    /// Serializes an object to JSON
    /// </summary>
    public static string Serialize(TType instance)
    {
        var serializer = new DataContractJsonSerializer(typeof(TType));
        using (var stream = new MemoryStream())
        {
            serializer.WriteObject(stream, instance);
            return Encoding.Default.GetString(stream.ToArray());
        }
    }

    /// <summary>
    /// DeSerializes an object from JSON
    /// </summary>
    public static TType DeSerialize(string json)
    {
        using (var stream = new MemoryStream(Encoding.Default.GetBytes(json)))
        {
            var serializer = new DataContractJsonSerializer(typeof(TType));
            return serializer.ReadObject(stream) as TType;
        }
    }
}
function generate_gallery_tab_navigation($atts)
{
    $args = array(
        'taxonomy' => 'gallery_category',
        'hide_empty' => -1,
        'orderby' => 'name',
        'order' => 'ASC'
    );

    $categories = get_categories($args);

    ob_start(); ?>

    <div class="gallery-tabs-wrapper">
        <ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
            <?php if (!empty($categories)) : ?>
                <?php $nav_counter = 1; ?>
                <?php foreach ($categories as $category) : ?>
                    <li class="nav-item" role="presentation">
                        <button class="nav-link <?php echo ($nav_counter === 1) ? 'active' : ''; ?>" id="pills-<?php echo $category->slug; ?>-tab" data-bs-toggle="pill" data-bs-target="#pills-<?php echo $category->slug; ?>" type="button" role="tab" aria-controls="pills-<?php echo $category->slug; ?>" aria-selected="<?php echo ($nav_counter === 1) ? 'true' : 'false'; ?>">
                            <?php echo $category->name; ?>
                        </button>
                    </li>
                    <?php $nav_counter++; ?>
                <?php endforeach; ?>
            <?php endif; ?>
        </ul>
    </div>

<?php
    return ob_get_clean();
}
add_shortcode('gallery_tab_navigation', 'generate_gallery_tab_navigation');

function generate_gallery_tab_content($atts)
{
    $args = array(
        'post_type' => 'gallery',
        'posts_per_page' => -1,
        'order' => 'ASC',
    );

    $gallery_posts = new WP_Query($args);

    ob_start(); ?>

    <div class="tab-content" id="pills-tabContent">
        <?php if ($gallery_posts->have_posts()) : ?>
            <?php
            $active_set = false;
            while ($gallery_posts->have_posts()) :
                $gallery_posts->the_post();
                $categories = get_the_terms(get_the_ID(), 'gallery_category');
                if ($categories) : ?>
                    <?php foreach ($categories as $category) : ?>
                        <div class="tab-pane fade <?php echo (!$active_set) ? 'show active' : ''; ?>" id="pills-<?php echo $category->slug; ?>" role="tabpanel" aria-labelledby="pills-<?php echo $category->slug; ?>-tab">
                            <div class="gallerys">
                                <div class="row">
                                    <?php
                                    $category_posts_args = array(
                                        'post_type' => 'gallery',
                                        'posts_per_page' => -1,
                                        'tax_query' => array(
                                            array(
                                                'taxonomy' => 'gallery_category',
                                                'field' => 'term_id',
                                                'terms' => $category->term_id,
                                            ),
                                        ),
                                    );
                                    $category_posts = new WP_Query($category_posts_args);
                                    if ($category_posts->have_posts()) : ?>
                                        <?php while ($category_posts->have_posts()) :
                                            $category_posts->the_post(); ?>
                                            <div class="col-md-4 gall-img">
                                                <div class="gallery_inner">
                                                    <a class="fancybox" data-fancybox="gallery" href="<?php echo wp_get_attachment_url(get_post_thumbnail_id()); ?>">
                                                        <?php the_post_thumbnail(); ?>
                                                    </a>
                                                </div>
                                            </div>
                                        <?php endwhile; ?>
                                    <?php endif; ?>
                                </div>
                            </div>
                        </div>
                        <?php
                        $active_set = true;
                        ?>
                    <?php endforeach; ?>
                <?php endif; ?>
            <?php endwhile; ?>
        <?php endif; ?>
    </div>

<?php
    wp_reset_postdata();
    return ob_get_clean();
}
add_shortcode('gallery_tab_content', 'generate_gallery_tab_content');
package com.lgcns.esg.entity;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.lgcns.esg.core.entity.BaseEntity;
import jakarta.persistence.*;
import lombok.*;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import java.time.LocalDateTime;
import java.util.List;

@Entity
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "D_SYSTEM_TYPE")
public class SystemType extends BaseEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "SYS_TYPE_ID")
    private Long id;
    @Column(name = "CODE",unique = true)
    private String code;
    @Column(name = "NAME")
    private String name;

    @Column(name = "DELETED_AT")
    private LocalDateTime deletedAt;

    @Column(name = "DELETED_BY")
    private String deletedBy;
    @Column(name = "IS_DELETED")
    private boolean deleted;
    @OneToMany(mappedBy = "systemType", cascade = CascadeType.ALL)
    @JsonBackReference
    private List<SystemParams> systemParams;
}
package com.lgcns.esg.entity;

import com.lgcns.esg.core.entity.BaseEntity;
import jakarta.persistence.*;
import lombok.*;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import java.time.LocalDateTime;

@Entity
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "D_SYSTEM_PARAMS")
public class SystemParams extends BaseEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "SYS_PARAMS_ID")
    private Long id;
    @Column(unique = true, name="CODE")
    private String code;
    @Column(name = "VALUE")
    private String value;

    @Column(name = "DELETED_AT")
    private LocalDateTime deletedAt;

    @Column(name = "DELETED_BY")
    private String deletedBy;
    @Column(name = "IS_DELETED")
    private boolean deleted;
    @ManyToOne(cascade = CascadeType.ALL)
    @JoinColumn(name = "SYS_TYPE_ID" )
    private SystemType systemType;

}
javascript: (function () {
  let host = location.host;
  if (host.includes("youtube.com")) {
    const emb = document
      .querySelector("link[itemprop='embedUrl']")
      .getAttribute("href");
    window.location.assign(emb);
  } else {
    window.alert("⚠️not YouTube");
  }
})();
> powershell -command "Get-ChildItem -Path C:\ -Recurse | Sort-Object Length -Descending | Select-Object FullName, Length -First 20 | Format-Table -AutoSize";
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":star: Introducing Xero Boost Days! :star:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Hey Toronto! \n\nWe're excited to announce the launch of our Boost Day Program!\n\nStarting this week, as part of our <https://xpresso.xero.com/blog/featured/more-opportunities-to-come-together-with-xeros-connect/|*Xeros Connect Strategy*>, you'll experience supercharged days at the office every *Tuesday* and *Thursday*. Get ready for a blend of delicious food, beverages, wellness activites, and fun connections!\n\nPlease see below for what's on this week! "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-30: Tuesday, 30th July",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Café Partnership*: Enjoy coffee and café-style beverages from our partner, *HotBlack Coffee*, located at 245 Queen St W, by showing your *Xero ID*.\n:breakfast: *Breakfast*: Provided by *Pico de Gallo* at *9AM* in the Kitchen."
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-1: Thursday, 1st August",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":coffee: *Café Partnership*: Enjoy coffee and café-style beverages from *HotBlack* by showing your *Xero ID*.\n:lunch: *Lunch*: Provided by *Chiang Mai* at *12:00PM* in the Kitchen.\n"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*LATER THIS MONTH:*"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*Thursday, 15th August*\n :standup: *Stand Up* hosted by Intern Engineer, *Daniel Iseoluwa*  \n *Thursday, 29th August*\n:blob-party: *Social +*: Drinks, food, and engaging activities bringing everyone together. "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Stay tuned to this channel for more details, check out the <https://calendar.google.com/calendar/embed?src=c_c6b67359544047155a77a16a960e9fd5817f52d7682bdffee2582d0d820db732%40group.calendar.google.com&ctz=America%2FToronto|*Tor Happenings Calendar*>, and get ready to Boost your workdays!\n\nLove,\nWX Team :party-wx:"
			}
		}
	]
}
Процедура ПриНачалеРаботыСистемы ()
	УстановитьКраткийЗаголовокПриложения ("Денис Кондрашов");
	
	МойВозраст = 25; 
	
	ЯИдуВДетскийСад = Ложь;
	ЯИдуВШколу = Ложь;
	ЯИдуНаРаботу = Ложь;  
	
	Если МойВозраст < 7 Тогда
		ЯИдуВДетскийСад = Истина;
		
	ИначеЕсли МойВозраст >= 7 И МойВозраст < 19 Тогда
		ЯИдуВШколу = Истина;
		
	Иначе ЯИдуНаРаботу = Истина;
		КонецЕсли;
				
КонецПроцедуры
Процедура ПриНачалеРаботыСистемы ()
	УстановитьКраткийЗаголовокПриложения ("Денис Кондрашов");
	
	МойВозраст = 20;
	Если МойВозраст < 7 Тогда
		ЯИдуВДетскийСад = Истина;
		ЯИдуВШколу = Ложь;
		
	ИначеЕсли МойВозраст >= 7 И МойВозраст < 19 Тогда
		ЯИдуВДетскийСад = Ложь;
		ЯИдуВШколу = Истина;
		
	Иначе ЯИдуНаРаботу = Истина;
		КонецЕсли;
				
КонецПроцедуры
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":brewbuddy: Boost Day: Brew Buddy Launch :brewbuddy:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "As a part of our exciting Boost Day program, the new elevated Cafe Experience will feature a new friend :people_hugging:\n \nJoin us in celebrating the launch of our favourite barista friend, *Brew Buddy*. To enhance and elevate your café experience, we're introducing a brand new tool for ordering your coffees, replacing the Asana board. "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":info_: Here's a few things to know:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:dot-blue:Brew Buddy is an enhanced barista service software created by an awesome group of grads as a part of Hackathon.\n\n:dot-blue:Our favourite feature is the Slack notification you get once your coffee is ready to go!\n\n:dot-blue:BIt is a more efficient way to order your coffee that minimises time away from work and creates a more seamless experience for Xero's and our baristas."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Keep an eye out for the *'Weekly Special'* option in the ordering form to keep up with the latest caffeine trends and try something new!\n\n*Love*,\n*WX Team* :party-wx:"
			}
		}
	]
}
 <script>
    jQuery(document).ready(function($){
        if (window.location.href == "https://dinglecrystal.ie/pages/factory-demonstrations" || window.location.href == "https://dinglecrystal.ie/products/factory-tour-30min") {
            $('body').append('<a href="https://fareharbor.com/embeds/book/dinglecrystal/?full-items=yes" style="font-family:\'Twentieth Century\', sans-serif !important; border:2px solid #FFFFFF !important; font-weight:bold !important; letter-spacing: 4.2px !important; box-shadow:none !important; padding: .2em 2em !important;" class="fh-hide--mobile fh-fixed--side fh-icon--cal fh-button-true-flat-color">BOOK TOUR</a><a href="https://fareharbor.com/embeds/book/dinglecrystal/?full-items=yes" style="font-family:\'Twentieth Century\', sans-serif !important; font-size: 1.1em !important; border:2px solid #FFFFFF !important; font-weight:bold !important; letter-spacing: 4.2px !important; box-shadow:none !important; padding: .2em 3em !important;" class="fh-hide--desktop fh-size--small fh-fixed--side fh-button-true-flat-color fh-color--white">BOOK TOUR</a>');
        }
    });
    </script>
# CICD using GitHub actions

name: CI/CD

# Exclude the workflow to run on changes to the helm chart
on:
  push:
    branches:
      - main
    paths-ignore:
      - 'helm/**'
      - 'k8s/**'
      - 'README.md'

jobs:

  build:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout repository
      uses: actions/checkout@v4

    - name: Set up Go 1.22
      uses: actions/setup-go@v2
      with:
        go-version: 1.22

    - name: Build
      run: go build -o go-web-app

    - name: Test
      run: go test ./...
  
  code-quality:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout repository
      uses: actions/checkout@v4

    - name: Run golangci-lint
      uses: golangci/golangci-lint-action@v6
      with:
        version: v1.56.2
  
  push:
    runs-on: ubuntu-latest

    needs: build

    steps:
    - name: Checkout repository
      uses: actions/checkout@v4

    - name: Set up Docker Buildx
      uses: docker/setup-buildx-action@v1

    - name: Login to DockerHub
      uses: docker/login-action@v3
      with:
        username: ${{ secrets.DOCKERHUB_USERNAME }}
        password: ${{ secrets.DOCKERHUB_TOKEN }}

    - name: Build and Push action
      uses: docker/build-push-action@v6
      with:
        context: .
        file: ./Dockerfile
        push: true
        tags: ${{ secrets.DOCKERHUB_USERNAME }}/go-web-app:${{github.run_id}}

  update-newtag-in-helm-chart:
    runs-on: ubuntu-latest

    needs: push

    steps:
    - name: Checkout repository
      uses: actions/checkout@v4
      with:
        token: ${{ secrets.TOKEN }}

    - name: Update tag in Helm chart
      run: |
        sed -i 's/tag: .*/tag: "${{github.run_id}}"/' helm/go-web-app-chart/values.yaml

    - name: Commit and push changes
      run: |
        git config --global user.email "vivekstyne5@gmail.com"
        git config --global user.name "Vivek-kumar-official"
        git add helm/go-web-app-chart/values.yaml
        git commit -m "Update tag in Helm chart"
        git push
package com.lgcns.esg.core.util;

import com.querydsl.core.BooleanBuilder;
import com.querydsl.core.types.Ops;
import com.querydsl.core.types.dsl.BooleanExpression;
import com.querydsl.core.types.dsl.ComparableExpressionBase;
import com.querydsl.core.types.dsl.Expressions;
import com.querydsl.core.types.dsl.StringExpression;
import org.springframework.util.CollectionUtils;

import java.util.List;
import java.util.Objects;

public class QueryBuilder {
    private QueryBuilder() {
    }

    public static final String EQUAL = "=";
    public static final String NOT_EQUAL = "!=";
    public static final String LIKE = "%";
    public static final String GREATER_THAN = ">";
    public static final String LESS_THAN = "<";
    public static final String GREATER_THAN_OR_EQUAL = ">=";

    public static final String LESS_THAN_OR_EQUAL = "=<";
    public static final String IN = "IN";
    public static final String NOT_IN = "NOT_IN";

    public static <T extends Comparable<?>> void buildSearchPredicate(BooleanBuilder condition, String operation, ComparableExpressionBase<T> field, T searchData) {
        if (Objects.nonNull(searchData)) {
            BooleanExpression expression = null;
            switch (operation) {
                case EQUAL -> expression = field.eq(searchData);
                case NOT_EQUAL -> expression = field.ne(searchData);
                case LIKE -> {
                    if (field instanceof StringExpression stringExpression) {
                        expression = stringExpression.containsIgnoreCase(searchData.toString());
                    } else {
                        throw new IllegalArgumentException("Field does not support 'like' operation");
                    }
                }
                case GREATER_THAN ->
                        expression = Expressions.booleanOperation(Ops.GT, field, Expressions.constant(searchData));
                case LESS_THAN ->
                        expression = Expressions.booleanOperation(Ops.LT, field, Expressions.constant(searchData));
                case GREATER_THAN_OR_EQUAL ->
                        expression = Expressions.booleanOperation(Ops.GOE, field, Expressions.constant(searchData));
                case LESS_THAN_OR_EQUAL ->
                        expression = Expressions.booleanOperation(Ops.LOE, field, Expressions.constant(searchData));
                default -> throw new IllegalArgumentException("Not support operator:" + operation);
            }
            if (expression != null) {
                condition.and(expression);
            }
        }
    }

    public static <T extends Comparable<?>> void buildSearchPredicate(BooleanBuilder condition, String operation, ComparableExpressionBase<T> field, List<T> searchData) {
        if (Objects.nonNull(searchData) && !CollectionUtils.isEmpty(searchData)) {
            switch (operation) {
                case IN -> condition.and(field.in(searchData));
                case NOT_IN -> condition.and(field.notIn(searchData));
                default -> throw new IllegalArgumentException("Not support operator:" + operation);
            }
        }
    }
}

Ready to elevate your business to the next level? Build your own blockchain ecosystem with CoinsQueens! This custom digital ledger system is designed just for you, giving you full control over operations, governance, and features. Enjoy enhanced security, faster processes, and tailor-made solutions to fit your specific needs.
apiVersion: apps/v1
kind: Deployment
metadata:
  name: go-web-app
  labels:
    app: go-web-app
spec:
  replicas: 1
  selector:
    matchLabels:
      app: go-web-app
  template:
    metadata:
      labels:
        app: go-web-app
    spec:
      containers:
      - name: go-web-app
        image: vivekstyne/go-web-app:v1
        ports:
        - containerPort: 8080
// Select the parent element
const parent = document.getElementById('parentElementId');

// While the parent has child nodes, remove the first one
while (parent.firstChild) {
    parent.removeChild(parent.firstChild);
}
Date: 29-7-2024              Section: III-I CSE-E
Topic: Functions
---------------------------------------------------------------------

1.Write a function named printWelcomeMessage that prints "Welcome to the Online Shopping App!" to the console. 
2.Write a function named printGoodbyeMessage that prints "Thank you for visiting the Online Shopping App!" to the console.
3.Write a function named addProduct that takes a String parameter productName and prints "Product <productName> added to the inventory".
 Note: Call this function with different product names.

4.Write a function named removeProduct that takes a String parameter productName and prints "Product <productName> removed from the inventory.". 
Note: Call this function with different product names. 

5. Write a function named calculateDiscount that takes two Double parameters price and discountRate, and returns the discounted price. Print the returned value in the main function.
6.Write a function named isProductAvailable that takes a String parameter productName and returns true if the product is available in stock, and false otherwise. 
Print the result in the main function.
7. Write a single-expression function named calculateTax that takes a Double parameter price and returns the tax amount (assume a tax rate of 10%). 
Print the result in the main function.
8. Write a single-expression function named calculateTotalPrice that takes two Double parameters price and tax and returns their sum. 
Print the result in the main function.
9. Write a function named createUserAccount that takes a String parameter userName with a default value of "Guest" and prints "User account <userName> created.". 
Note: Call this function with and without passing a user name.
10. Write a function named applyCoupon that takes a Double parameter discount with a default value of 10.0 and prints "Coupon applied with <discount>% discount.". 
Note: Call this function with and without passing a discount.
11. Write a function named updateUserProfile that takes three String parameters firstName, lastName, and email, and prints "User profile updated: <firstName> <lastName>, Email: <email>". 
Call this function using named arguments.
12. Write a function named placeOrder that takes three String parameters productName, deliveryAddress, and paymentMethod, and prints "Order placed for <productName> to be delivered at <deliveryAddress> using <paymentMethod>". 
note: Call this function using named arguments and print the result.



Date: 29-7-2024              Section: III-I CSE-E
Topic: Functions
---------------------------------------------------------------------

1.Write a function named printWelcomeMessage that prints "Welcome to the Online Shopping App!" to the console. 
2.Write a function named printGoodbyeMessage that prints "Thank you for visiting the Online Shopping App!" to the console.
3.Write a function named addProduct that takes a String parameter productName and prints "Product <productName> added to the inventory".
 Note: Call this function with different product names.

4.Write a function named removeProduct that takes a String parameter productName and prints "Product <productName> removed from the inventory.". 
Note: Call this function with different product names. 

5. Write a function named calculateDiscount that takes two Double parameters price and discountRate, and returns the discounted price. Print the returned value in the main function.
6.Write a function named isProductAvailable that takes a String parameter productName and returns true if the product is available in stock, and false otherwise. 
Print the result in the main function.
7. Write a single-expression function named calculateTax that takes a Double parameter price and returns the tax amount (assume a tax rate of 10%). 
Print the result in the main function.
8. Write a single-expression function named calculateTotalPrice that takes two Double parameters price and tax and returns their sum. 
Print the result in the main function.
9. Write a function named createUserAccount that takes a String parameter userName with a default value of "Guest" and prints "User account <userName> created.". 
Note: Call this function with and without passing a user name.
10. Write a function named applyCoupon that takes a Double parameter discount with a default value of 10.0 and prints "Coupon applied with <discount>% discount.". 
Note: Call this function with and without passing a discount.
11. Write a function named updateUserProfile that takes three String parameters firstName, lastName, and email, and prints "User profile updated: <firstName> <lastName>, Email: <email>". 
Call this function using named arguments.
12. Write a function named placeOrder that takes three String parameters productName, deliveryAddress, and paymentMethod, and prints "Order placed for <productName> to be delivered at <deliveryAddress> using <paymentMethod>". 
note: Call this function using named arguments and print the result.



<section class="app">

  <aside class="sidebar">

         <header>

        Menu

      </header>

    <nav class="sidebar-nav">

 

      <ul>

        <li>

          <a href="#"><i class="ion-bag"></i> <span>Shop</span></a>

          <ul class="nav-flyout">

            <li>

              <a href="#"><i class="ion-ios-color-filter-outline"></i>Derps</a>

            </li>

            <li>

              <a href="#"><i class="ion-ios-clock-outline"></i>Times</a>

            </li>

            <li>

              <a href="#"><i class="ion-android-star-outline"></i>Hates</a>

            </li>

            <li>

              <a href="#"><i class="ion-heart-broken"></i>Beat</a>
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": "🌟 Melbourne Boost Day Reminder! 🌟"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Good morning Melbourne!\n\n \n\n  Get ready for a fantastic Boost Day with these exciting offerings: \n\n ☕ *Xero Café:* Enjoy delicious café-style beverages crafted by our skilled baristas, and sweet treats like Lemon Slices, Yo-Yo Biscuits (Gluten Free), Almond Crescents + Biscoff Biscuits!\n\n 📋 *Weekly Café Special:* Indulge in a delicious Biscoff Latte! \n\n :cake: *Afternoon Tea*: Wind down your day with a delicious afternoon tea provided by Your Private Chef from 2pm - 3pm in the L3 Kitchen. \n\n 💆🏽‍♀️*Wellbeing:* Book a massage <https://bookings.corporatebodies.com/|*here*> to relax and unwind. \n *Username:* xero \n *Password:* 1234 \n\n :fruits: *Lastly*, we now have a blender! Create your perfect mix for a delicious smoothie using our fresh fruit delivered on Mondays and Wednesdays! \n\n Enjoy your delicious smoothies and remember to #washyourowncoffeecup and clean up after yourself so the next Xero can enjoy too!"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Stay tuned to this channel for more details, check out the <https://calendar.google.com/calendar/u/0?cid=Y19xczkyMjk5ZGlsODJzMjA4aGt1b3RnM2t1MEBncm91cC5jYWxlbmRhci5nb29nbGUuY29t|*Melbourne Social Calendar*>, and get ready to Boost your workdays!\n\nLove,\nWX Team :party-wx:"
			}
		}
	]
}
import pandas as pd
from sklearn.preprocessing import LabelEncoder

data={
    'Car':['Toyota','Ford','BMW','Audi','Toyota'],
}
df=pd.DataFrame(data)

label_encoder=LabelEncoder()
df['Car_Label']= label_encoder.fit_transform(df['Car'])
print(df)
***********************************
  import pandas as pd
from sklearn.preprocessing import LabelEncoder

data={
    'Student':['Alica','Bob','Charlie','David','Eva'],
    'Score':[85,67,90,45,76],
    'Pass/Fail':['Pass','Pass','Pass','Fail','Pass']
}
df=pd.DataFrame(data)
print(df)

********************************
  #label encoding for the pass/fail column
label_encoder=LabelEncoder()
df['Pass/Fail_label']= label_encoder.fit_transform(df['Pass/Fail'])
print('data frame after encoding:')
print(df)
*******************************************
  import pandas as pd
from sklearn.preprocessing import OneHotEncoder

data={'City':['New York','Los Angels','Chicago','Houston','Phoenix']}
df=pd.DataFrame(data)
print(df)
*************************************
  one_hot_encoder=OneHotEncoder(sparse=False)
one_hot_encoded=one_hot_encoder.fit_transform(df[['City']])

one_hot_df=pd.DataFrame(one_hot_encoded,columns=one_hot_encoder.get_feature_names_out(['City']))
df=pd.concat([df,one_hot_df],axis=1)

print(df)
*****************************************************************
  O_h_e=OneHotEncoder(sparse=False)
One_h_e=O_h_e.fit_transform(df[['City']])
o_h_df=pd.DataFrame(One_h_e,columns=O_h_e.get_feature_names_out(['City']))
pd=pd.concat([df,o_h_df],axis=1)
print(pd)
************************************************************
  import pandas as pd
from sklearn.preprocessing import OneHotEncoder
data={
    'name':['Alice','Bob','Charlie','David','Eve'],
    'gender':['Female','Male','Male','Male','Female'],
    'age':[24,30,22,35,28]
}
df=pd.DataFrame(data)
print(df)
O_h_e=OneHotEncoder(sparse=False)
One_h_e=O_h_e.fit_transform(df[['gender']])
o_h_df=pd.DataFrame(One_h_e,columns=O_h_e.get_feature_names_out(['gender']))
pd=pd.concat([df,o_h_df],axis=1)
print(pd)
****************************************************
  import pandas as pd
from sklearn.preprocessing import OrdinalEncoder
data={
    'Student':['Alice','Bob','Charlie','David','Eve'],
    'Grade':['A','B','A','C','B']
}
df=pd.DataFrame(data)
df
a=OrdinalEncoder(categories=[['C','B','A']])
df['Grade_Ordinal']=a.fit_transform(df[['Grade']])
df
************************************************
%matplotlib
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import sklearn
data=pd.read_csv("/content/Data.csv")
data.head()
****************
  data.shape
df=pd.DataFrame(data)
df

X=df.iloc[:,:-1].values
Y=df.iloc[:,-1].values
print(X)
********************************************
  df2=df.copy()
df2.fillna(df2["Age"].mean(),inplace=True)
df2.fillna(df2["Salary"].mean(),inplace=True)
print(df2.isnull().sum())
*****************************************
from sklearn.compose import ColumnTransformer
from sklearn.preprocessing import OneHotEncoder
ct=ColumnTransformer(transformers=[('encoder',OneHotEncoder(),[0])],remainder='passthrough')
x=np.array(ct.fit_transform(x))
print(x)
*****************************
  from sklearn.preprocessing import LabelEncoder
le=LabelEncoder()
y=le.fit_transform(y)
y
*************************************
  from sklearn.model_selection import train_test_split
x_train,x_test,y_train,y_test=train_test_split(x,y,test_size=0.2,random_state=1)
print(x_train)
Get-ChildItem ".\FileStore" |
Select-Object Name, PSPath |
Add-Member -MemberType MemberSet `
           -Name PSStandardMembers `
           -Value ([System.Management.Automation.PSPropertySet]::new(
                      'DefaultDisplayPropertySet',
                      [string[]]('Name')
                  )) `
           -PassThru |
Out-GridView -PassThru -Title "Quick Notes" |
Get-Content | Set-Clipboard
   # Create the new ACE  
   $identity = 'domain\group'  
   $rights = 'FullControl'  
   $type = 'Allow'  
     
   # Folders and files inherit this permission, no need to propagate because it will be inherited  
   $inheritance = 'ContainerInherit, ObjectInherit'  
   $propagate = 'None'  
     
   $ace = New-Object System.Security.AccessControl.FileSystemAccessRule($identity, $rights, $inheritance, $propagate, $type)  
     
   # Apply to existing file system object  
   $acl = Get-Acl -Path 'YourPath'  
   $acl.AddAccessRule($ace)  
   Set-Acl -Path 'YourPath' -AclObject $acl  
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":star: Boost Day is Here! :star:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Hey Brisbane! \n\nIt's Boost Day!\n\nCheck out today's fantastic lineup: "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-29: Monday, 29th July",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Café Partnership*: Enjoy free coffee and café-style beverages from our Cafe partner *Edwards*.\n:Lunch: *Lunch*: Provided by *DannyBoys Rockstar Sandwiches* from *12pm* in the kitchen.\n:massage:*Wellbeing*: Pilates at *SP Brisbane City* is bookable every Monday! Watch this channel on how to book."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "plain_text",
				"text": "Have an amazing Boost Day, Brisbane!\n\nLove,\n\nWX  :party-wx:  ",
				"emoji": true
			}
		}
	]
}
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":star: Boost Day is Here! :star:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Hey Wellington! \n\nIt's Boost Day!\n\nCheck out today's fantastic lineup: "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-30: Tuesday, 30th July",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Xero Café*: Café-style beverages and sweet treats.\n:clipboard: *Weekly Café Special*: _Caramel Mocha Latte_.\n:breakfast: *Breakfast*: Provided by *Simply Food* from *8AM - 10AM* in the All Hands.\n:massage:*Wellbeing - Massage*: Book a session <https://www.google.com/|*here*> to relax and unwind."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "plain_text",
				"text": "Have an amazing Boost Day, Wellington!\n\nLove,\n\nWX  :party-wx:  ",
				"emoji": true
			}
		}
	]
}
function validateString(str) {
  return str && str.trim().length > 5 ? str : null;
}
WEBSITEpwd=4.12345
GOOGLEpwd=4.12345
SYMENUpwd=4.12345
UGMFREEpwd=4.12345
#include<iostream>
using namespace std;

int main()
{
   cout << "hello world"<< endl;
}
[
  {
    "key": "tab",
    "command": "editor.action.inlineSuggest.commit",
    "when": "textInputFocus && inlineSuggestionHasIndentationLessThanTabSize && inlineSuggestionVisible && !editorTabMovesFocus"     
  }
]
a, b, c = 5, 3.2, 'Hello'

print (a)  # prints 5
print (b)  # prints 3.2
print (c)  # prints Hello 
star

Tue Jul 30 2024 21:01:48 GMT+0000 (Coordinated Universal Time)

@tanushahaha

star

Tue Jul 30 2024 20:59:21 GMT+0000 (Coordinated Universal Time)

@tanushahaha

star

Tue Jul 30 2024 20:59:20 GMT+0000 (Coordinated Universal Time)

@tanushahaha

star

Tue Jul 30 2024 20:54:33 GMT+0000 (Coordinated Universal Time)

@tanushahaha

star

Tue Jul 30 2024 20:34:52 GMT+0000 (Coordinated Universal Time)

@odesign

star

Tue Jul 30 2024 19:55:47 GMT+0000 (Coordinated Universal Time)

@RobertoSilvaZ #mongoshell #sql #mongo

star

Tue Jul 30 2024 19:04:20 GMT+0000 (Coordinated Universal Time)

@WXCanada

star

Tue Jul 30 2024 17:52:47 GMT+0000 (Coordinated Universal Time) https://reeborg.ca/reeborg.html?lang

@MD_MASUD #undefined

star

Tue Jul 30 2024 17:51:35 GMT+0000 (Coordinated Universal Time) https://reeborg.ca/reeborg.html?lang

@MD_MASUD #undefined

star

Tue Jul 30 2024 17:50:29 GMT+0000 (Coordinated Universal Time) https://reeborg.ca/reeborg.html?lang

@MD_MASUD #undefined

star

Tue Jul 30 2024 17:49:54 GMT+0000 (Coordinated Universal Time) https://reeborg.ca/reeborg.html?lang

@MD_MASUD #undefined

star

Tue Jul 30 2024 17:49:39 GMT+0000 (Coordinated Universal Time) https://reeborg.ca/reeborg.html?lang

@MD_MASUD #undefined

star

Tue Jul 30 2024 16:30:33 GMT+0000 (Coordinated Universal Time) https://techcommunity.microsoft.com/t5/windows-server-for-it-pro/disable-automatic-proxy-setup-automatically-detect-settings/m-p/3896157

@Curable1600 #windows #browsers #youtube

star

Tue Jul 30 2024 15:45:43 GMT+0000 (Coordinated Universal Time)

@signup

star

Tue Jul 30 2024 15:19:54 GMT+0000 (Coordinated Universal Time)

@shm1ckle #php

star

Tue Jul 30 2024 13:08:17 GMT+0000 (Coordinated Universal Time)

@WXCanada

star

Tue Jul 30 2024 11:29:12 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/9573119/how-to-parse-json-without-json-net-library

@rick_m #cs

star

Tue Jul 30 2024 11:23:49 GMT+0000 (Coordinated Universal Time)

@BilalRaza12

star

Tue Jul 30 2024 08:41:11 GMT+0000 (Coordinated Universal Time)

@namnt

star

Tue Jul 30 2024 08:40:51 GMT+0000 (Coordinated Universal Time)

@namnt

star

Tue Jul 30 2024 01:20:15 GMT+0000 (Coordinated Universal Time)

@agedofujpn #javascript

star

Tue Jul 30 2024 01:01:41 GMT+0000 (Coordinated Universal Time)

@RobertoSilvaZ #powershell #windows11 #system #performance

star

Mon Jul 29 2024 20:28:20 GMT+0000 (Coordinated Universal Time)

@WXCanada

star

Mon Jul 29 2024 12:10:21 GMT+0000 (Coordinated Universal Time)

@Denixis24

star

Mon Jul 29 2024 12:02:27 GMT+0000 (Coordinated Universal Time)

@Denixis24

star

Mon Jul 29 2024 10:21:15 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Mon Jul 29 2024 09:46:05 GMT+0000 (Coordinated Universal Time)

@Shira

star

Mon Jul 29 2024 09:43:59 GMT+0000 (Coordinated Universal Time)

@Vivekstyn

star

Mon Jul 29 2024 09:40:30 GMT+0000 (Coordinated Universal Time)

@namnt

star

Mon Jul 29 2024 09:33:58 GMT+0000 (Coordinated Universal Time) https://www.coinsqueens.com/blog/create-your-own-blockchain-network

@Kiruthikaa #ownblockchainecosystem #blockchaindevelopment #smartcontractintegration

star

Mon Jul 29 2024 08:36:38 GMT+0000 (Coordinated Universal Time)

@Vivekstyn

star

Mon Jul 29 2024 08:32:29 GMT+0000 (Coordinated Universal Time)

@davidmchale #firstchild #remove

star

Mon Jul 29 2024 08:24:04 GMT+0000 (Coordinated Universal Time)

@signup

star

Mon Jul 29 2024 08:22:37 GMT+0000 (Coordinated Universal Time)

@signup

star

Mon Jul 29 2024 07:30:26 GMT+0000 (Coordinated Universal Time) https://dubverse.ai/

@UbedKhan

star

Mon Jul 29 2024 05:17:26 GMT+0000 (Coordinated Universal Time) https://codepen.io/StephenScaff/pen/bVbEbJ

@jg #undefined

star

Mon Jul 29 2024 04:43:05 GMT+0000 (Coordinated Universal Time)

@WXAPAC

star

Mon Jul 29 2024 03:55:08 GMT+0000 (Coordinated Universal Time)

@signup

star

Mon Jul 29 2024 02:25:10 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/53323526/select-object-with-out-gridview

@baamn #powershell #out-gridview

star

Mon Jul 29 2024 00:35:27 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-us/answers/questions/1118931/powershell-on-modifying-permissions

@baamn #powershell

star

Mon Jul 29 2024 00:26:46 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Mon Jul 29 2024 00:20:59 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Sun Jul 28 2024 23:43:44 GMT+0000 (Coordinated Universal Time)

@davidmchale #function #ternary

star

Sun Jul 28 2024 23:19:00 GMT+0000 (Coordinated Universal Time) https://www.ugmfree.it/forum/messages.aspx?TopicID

@baamn #passwords #security

star

Sun Jul 28 2024 21:42:10 GMT+0000 (Coordinated Universal Time)

@E23CSEU1151

star

Sun Jul 28 2024 15:37:46 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/71818580/how-to-enable-github-copilot-typing-tab-to-auto-completes-in-markdown-files

@destinyChuck #json #vscode

star

Sun Jul 28 2024 15:27:42 GMT+0000 (Coordinated Universal Time) undefined

@Shook87

star

Sun Jul 28 2024 14:48:24 GMT+0000 (Coordinated Universal Time) https://sourceforge.net/p/docfetcher/discussion/702424/thread/943ff8cc/

@baamn

star

Sun Jul 28 2024 14:05:57 GMT+0000 (Coordinated Universal Time)

@hacktivist

Save snippets that work with our extensions

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