Snippets Collections
sequenceDiagram
    participant User as SFM_UI
    participant SFM_MS as SFM Microservice (SFM_MS)
    participant AI_Scenario_Manager as AI Scenario Manager
    participant Workflow_Client as Workflow Client
    participant Job_Management_Service as Job Management Service
    participant ETL_Process as ETL Process
    participant AiEmissionResult as sap.sfm.AiEmissionResult
    participant EmissionBySupplier as sap.smf.EmissionBySupplier

    User->>SFM_MS: Select Commodity/Supplier (Trigger AI Scenario)
    SFM_MS->>AI_Scenario_Manager: Activate AI Scenario (Subscription Request)
    AI_Scenario_Manager-->>SFM_MS: Confirm Activation (Create AIScenarioTenant)
    SFM_MS->>AI_Scenario_Manager: Trigger CO2 Data Enrichment
    AI_Scenario_Manager->>Workflow_Client: Submit Workflow
    Workflow_Client->>Job_Management_Service: Execute PySpark Jobs
    Job_Management_Service-->>Workflow_Client: Scenario Complete
    Workflow_Client-->>AI_Scenario_Manager: Scenario Complete
    AI_Scenario_Manager-->>SFM_MS: Return Enriched CO2 Data
    SFM_MS->>AiEmissionResult: Store Results (RAW Zone)
    ETL_Process->>AiEmissionResult: Extract Data (Source)
    ETL_Process->>EmissionBySupplier: Update Fact Table (Fill Missing Values)
camera_usb_options="-r 640x480 -f 10 -y"
#include <bits/stdc++.h>
using namespace std;

void D(int N, vector<pair<int, int>> adj[], int source) {
    vector<int> dist(N, 1000000); // Khởi tạo khoảng cách đến tất cả các đỉnh là vô cùng
    dist[source] = 0; // Khoảng cách từ đỉnh nguồn đến chính nó là 0
    priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq; // Hàng đợi ưu tiên
    pq.push({0, source});

    while (!pq.empty()) { // Trong khi hàng đợi không rỗng
        int u = pq.top().second; // Lấy đỉnh có khoảng cách nhỏ nhất
        int d = pq.top().first;   // Khoảng cách từ nguồn đến đỉnh u
        pq.pop();

        // Duyệt các đỉnh kề của đỉnh u
        for (int i = 0; i < adj[u].size(); i++) {
            int v = adj[u][i].first;     // Đỉnh kề
            int weight = adj[u][i].second; // Trọng số của cạnh

            // Nếu tìm được đường đi ngắn hơn đến đỉnh v
            if (dist[v] > dist[u] + weight) {
                dist[v] = dist[u] + weight;
                pq.push({dist[v], v}); // Đẩy khoảng cách mới vào hàng đợi
            }
        }
    }

    // In ra kết quả khoảng cách từ đỉnh nguồn đến tất cả các đỉnh khác
    for (int i = 0; i < N; i++) {
        cout << "Khoảng cách từ " << source << " đến " << i << " là " << dist[i] << endl;
    }
}

int main() {
    int N, M; // Số đỉnh, số cạnh
    cin >> N >> M;
    
    vector<pair<int, int>> adj[N]; // Mảng vector để lưu đồ thị
    for (int i = 0; i < M; i++) {
        int a, b, c;
        cin >> a >> b >> c;
        adj[a].push_back({b, c}); // Đồ thị có hướng
        adj[b].push_back({a, c}); // Nếu đồ thị là vô hướng
    }

    int source;
    cin >> source;
    D(N, adj, source);

    return 0;
}
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": "✨ :magic_wand::xero-unicorn: End of Year Celebration – A Sprinkle of Magic! :xero-unicorn: :magic_wand:✨",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*Hi Melbourne!* \nGet ready to wrap up the year with a sprinkle of magic and a lot of fun at our End of Year Event! Here’s everything you need to know:"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"fields": [
				{
					"type": "mrkdwn",
					"text": "*📅 When:*\nThursday 28th November"
				},
				{
					"type": "mrkdwn",
					"text": "*📍 Where:*\n<https://www.google.com/maps/place/The+Timber+Yard/@-37.8331021,144.918894,17z/data=!3m1!4b1!4m6!3m5!1s0x6ad667735e56fcab:0x966480f06c58c00c!8m2!3d-37.8331021!4d144.9214743!16s/g/11gyy7sy4c?entry=ttu&g_ep=EgoyMDI0MDkxOC4xIKXMDSoASAFQAw==/|*The Timber Yard*> \n351 Plummer Street, Port Melbourne"
				},
				{
					"type": "mrkdwn",
					"text": "*⏰ Time:*\n4 PM - 10 PM"
				}
			]
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*:magic_wand::xero-unicorn: Theme:*\n_A Sprinkle of Magic_ – Our theme is inspired by the Xero Unicorn, embracing creativity, inclusivity, and diversity. Expect unique decor, magical moments, and a fun-filled atmosphere!"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*:dress: Dress Code:*\nSmart casual – Show your personality, but no Xero tees or lanyards, please!\nIf you're feeling inspired by the theme, why not add a little 'Sprinkle of Magic' to your outfit? Think glitter, sparkles, or anything that shows off your creative side! (Totally optional, of course! ✨)"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*🚍 Transport Info:*\n*Public Transport:* Via bus routes 234 & 235 - 5 min walk from bus stop\n*Parking:* 200+ unmetered and untimed spaces on Plummer & Smith Street\n*Xero Chartered Bus:* 3:15 PM departure from the Melbourne office - opt-in via your email invite."
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*🎤 :hamburger: Entertainment & Food:*\nPrepare to be dazzled by live music, enchanting magic shows, cozy chill-out zones, delicious bites, refreshing drinks, and plenty of surprises! ✨🎶"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*🎟 RSVP Now:*\nPlease click <https://xero-wx.jomablue.com/reg/store/eoy_mel|*here*> to RSVP!\nMake sure you RSVP by [insert RSVP deadline]!"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":question::question:Got questions? See the <https://docs.google.com/document/d/1iygJFHgLBRSdAffNsg3PudZCA45w6Wit7xsFxNc_wKM/edit|FAQs> doc or post in the Slack channel.\nWe can’t wait to celebrate with you! :partying_face: :xero-love:"
			}
		}
	]
}
{
  "FFlagAXAccessoryAdjustment": "True",
  "FFlagAddArialToLegacyContent": "False",
  "FFlagAccessoryAdjustmentEnabled3": "True",
  "FIntDebugForceMSAASamples": "1",
  "DFFlagESGamePerfMonitorEnabled": "False",
  "FFlagEnableV3MenuABTest3": "False",
  "FFlagLuaAppsEnableParentalControlsTab": "False",
  "FFlagVoiceBetaBadge": "false",
  "FFlagDebugDisableTelemetryV2Event": "True",
  "FFlagDebugDisableTelemetryV2Counter": "True",
  "DFFlagDebugPerfMode": "True",
  "FIntMeshContentProviderForceCacheSize": "268435456",
  "FIntFRMMinGrassDistance": "0",
  "FIntTerrainOTAMaxTextureSize": "1024",
  "FFlagDebugDisableTelemetryEphemeralStat": "True",
  "FFlagRenderPerformanceTelemetry": "False",
  "FFlagEnableNewFontNameMappingABTest2": "False",
  "FIntRenderShadowIntensity": "0",
  "FFlagAXAccessoryAdjustmentIXPEnabledForAll": "True",
  "FIntRenderGrassDetailStrands": "0",
  "FFlagTopBarUseNewBadge": "false",
  "FIntFullscreenTitleBarTriggerDelayMillis": "3600000",
  "FFlagAdServiceEnabled": "False",
  "FIntStartupInfluxHundredthsPercentage": "0",
  "FFlagEnableInGameMenuControls": "True",
  "FFlagEnableReportAbuseMenuRoactABTest2": "False",
  "FIntUITextureMaxRenderTextureSize": "1024",
  "FFlagEnableInGameMenuChromeABTest3": "False",
  "FFlagEnableVisBugChecks27": "True",
  "FFlagNullCheckCloudsRendering": "True",
  "FFlagDebugSkyGray": "True",
  "FFlagDebugDisableTelemetryEphemeralCounter": "True",
  "DFIntAvatarFaceChatHeadRollLimitDegrees": "360",
  "FIntRenderLocalLightUpdatesMin": "1",
  "FFlagPreloadTextureItemsOption4": "True",
  "FIntRenderLocalLightUpdatesMax": "1",
  "DFIntUserIdPlayerNameLifetimeSeconds": "86400",
  "FFlagFixGraphicsQuality": "True",
  "DFFlagUseVisBugChecks": "True",
  "FStringVoiceBetaBadgeLearnMoreLink": "null",
  "FIntHSRClusterSymmetryDistancePercent": "10000",
  "FFlagEnableReportAbuseMenuRoact2": "false",
  "FFlagDebugDisableOTAMaterialTexture": "true",
  "FFlagGraphicsGLEnableSuperHQShadersExclusion": "False",
  "FFlagEnableMenuControlsABTest": "False",
  "FFlagLuaAppUseUIBloxColorPalettes1": "true",
  "FFlagDisableFeedbackSoothsayerCheck": "False",
  "FFlagEnableQuickGameLaunch": "False",
  "FIntDefaultMeshCacheSizeMB": "256",
  "FIntFRMMaxGrassDistance": "0",
  "FFlagAddGothamToLegacyContent": "False",
  "FFlagPreloadMinimalFonts": "True",
  "DFIntTimestepArbiterThresholdCFLThou": "300",
  "FFlagUserHideCharacterParticlesInFirstPerson": "True",
  "FFlagAXAccessoryAdjustmentIXPEnabled": "True",
  "FFlagControlBetaBadgeWithGuac": "false",
  "FFlagEnableInGameMenuModernization": "True",
  "FFlagEnableMenuModernizationABTest2": "False",
  "FFlagDebugDisableTelemetryEventIngest": "True",
  "FIntReportDeviceInfoRollout": "0",
  "FFlagTaskSchedulerLimitTargetFpsTo2402": "False",
  "FIntCameraMaxZoomDistance": "99999",
  "FIntRobloxGuiBlurIntensity": "0",
  "DFIntAssetPreloading": "9999999",
  "FFlagLuaAppEnableFoundationColors": "True",
  "FFlagGraphicsSettingsOnlyShowValidModes": "True",
  "FFlagUIBloxUseNewThemeColorPalettes": "true",
  "FFlagPreloadAllFonts": "True",
  "FFlagEnableMenuModernizationABTest": "False",
  "FFlagLuaAppChartsPageRenameIXP": "False",
  "FFlagEnableBetterHapticsResultHandling": "True",
  "FFlagRenderGpuTextureCompressor": "True",
  "FFlagEnableNewInviteMenuIXP2": "False",
  "FFlagDebugDisableTelemetryV2Stat": "True",
  "FFlagEnableReportAbuseMenuLayerOnV3": "false",
  "FFlagGraphicsGLEnableHQShadersExclusion": "False",
  "FFlagDebugGraphicsPreferD3D11": "True",
  "FFlagRenderCheckThreading": "True",
  "FFlagEnableBetaBadgeLearnMore": "false",
  "FFlagDebugDisableTelemetryPoint": "True",
  "DFIntNumAssetsMaxToPreload": "9999999",
  "FFlagEnableInGameMenuChromeABTest2": "False",
  "FFlagAXAvatarFetchResultCamelCase": "True",
  "FIntTerrainArraySliceSize": "0",
  "FFlagEnableInGameMenuChrome": "False",
  "FFlagDisablePostFx": "True",
  "FFlagBetaBadgeLearnMoreLinkFormview": "false",
  "FFlagEnableFavoriteButtonForUgc": "true",
  "FFlagEnableAudioOutputDevice": "false",
  "DFFlagDisableDPIScale": "True",
  "FFlagUIBloxDevUseNewFontNameMapping": "False",
  "FFlagEnableCommandAutocomplete": "False",
  "FFlagRenderFixFog": "True",
  "FIntEnableVisBugChecksHundredthPercent27": "100",
  "FFlagUpdateHealthBar": "True",
  "FIntGameGridFlexFeedItemTileNumPerFeed": "0",
  "FIntGrassMovementReducedMotionFactor": "0",
  "FFlagLuaAppGenreUnderConstruction": "False",
  "FFlagChatTranslationEnableSystemMessage": "False",
  "FFlagToastNotificationsProtocolEnabled2": "False",
  "DFIntDebugFRMQualityLevelOverride": "1"
}
import data from "./data.json"; // this is the json data

// the json data looks like this

{
  "locations": {

    "brisbaneCityLibrary": {
      "name": "Brisbane City Library",
      "lat": -27.4710107,
      "lng": 153.0234489,
      "website": "https://www.brisbane.qld.gov.au/facilities-recreation/cultural/brisbane-city-library",
      "tel": "+61 7 3403 8888",
      "email": "library@brisbane.qld.gov.au",
      "category": "Library"
    },
    "goldCoastCommunityCentre": {
      "name": "GoldCoast Community Centre",
      "lat": -28.016667,
      "lng": 153.399994,
      "website": "https://www.goldcoast.qld.gov.au/community/community-centres",
      "tel": "+61 7 5667 5973",
      "email": "community@goldcoast.qld.gov.au",
      "category": "Training"
    },
  }

(function () {
  "use strict";

  // Variables
  const dummyData = data.locations; // this pulling the locations from the json data
  const checkboxesWrapper = document.querySelector(".checkers");
  const list = document.querySelector(".filtered-list");
  let filteredItems = [];
  let selectedCategories = [];

  // Get specific data needed from the API and return a new array of data
  function getListData(data) {
    if (!data) return [];
    return Object.entries(data).map(([index, item]) => ({
      name: item.name,
      category: item.category,
      web: item.website,
    }));
  }

  // Generate HTML for each item
  function itemHTML({ name, category, web }) {
    return `
      <li>
        <h3>${name}</h3>
        <p>Category: ${category}</p>
        <p>Website: <a href="${web}" target="_blank" rel="noopener noreferrer">${web}</a></p>
      </li>`;
  }

  // Generate HTML for checkboxes
  function checkboxHTML(category) {
    return `
      <label>
        <input type="checkbox" class="filter-checkbox" name="checkbox" role="checkbox" value="${category}"/>
        ${category}
      </label>`;
  }

  // Display checkboxes in the DOM
  function displayCheckBoxes(array) {
    const data = getListData(array);
    console.log(data);
    const allCategories = data.map((item) => item.category).filter(Boolean);
    const categories = [...new Set(allCategories)]; // Remove duplicates and ret

    const checkBoxHTML = categories.map(checkboxHTML).join("");
    checkboxesWrapper.innerHTML = checkBoxHTML; // Replace content
  }

  // Display items in the DOM
  function displayitems() {
    const itemData = getListData(
      filteredItems.length > 0 ? filteredItems : dummyData
    );

    const listHTML = itemData.map(itemHTML).join("");
    list.innerHTML = listHTML; // Replace content
  }

  // Check if a value exists in an array
  function isValueInArray(array, valueToCheck) {
    return array.some((item) => item === valueToCheck);
  }

  // Handle checkbox changes
  function onHandleCheck(box) {
    if (!box) return;

    box.addEventListener("change", function (e) {
      const { currentTarget } = e;
      const catValue = currentTarget.value.toLowerCase(); // Get the category value from the checkbox clicked
      const isChecked = currentTarget.checked; // Get true or false if the checkbox is clicked or not

      const isExisting = isValueInArray(selectedCategories, catValue);

      console.log({ catValue, isChecked, isExisting });

      // Add to array if checked and not already existing
      if (isChecked && !isExisting) {
        selectedCategories.push(catValue);
      }

      // Remove if unchecked and category exists
      if (!isChecked && isExisting) {
        selectedCategories = selectedCategories.filter(
          (cat) => cat !== catValue
        );
      }

      console.log({ selectedCategories });

      // Filter items based on selected categories
      filteredItems = Object.values(dummyData).filter((item) =>
        selectedCategories.includes(item.category.toLowerCase())
      );

      // Update the displayed items
      displayitems();
    });
  }

  // Initialize the application
  function init() {
    // Initially populate checkboxes based on all categories from dummyData
    displayCheckBoxes(dummyData);
    // Initially populate the list of items based on dummyData
    displayitems();

    const domCheckBoxes = document.querySelectorAll(".filter-checkbox");
    if (!domCheckBoxes) return;
    domCheckBoxes.forEach(onHandleCheck);
  }

  init();
})();
// toogle class that takes in the element, the class we want to toggle and force
//force can be set to or false to set the class to show always
const toggleClass = (element, className, force) => {
        element.classList.toggle(className, force);
    };


// were using this function to hide and show on an element that is clicked only
// this is why current target is passed into the function,
// the second param we are also passing force, but setting to true so 
const toggleSpan = (currentTarget, force = true) => {
        const compareBlock = currentTarget.closest(".compare-block");
        const currentSpan = compareBlock.querySelector("span");
        toggleClass(currentSpan, "show", force);
        if (currentSpan.className.indexOf("show") > -1) {
            currentSpan.setAttribute("aria-hidden", "false");
        } else {
            currentSpan.setAttribute("aria-hidden", "true");
        }
    };


compareBtns.forEach((button) => toggleSpan(button, false));
To Do This	Use Command
Enter or exit fullscreen
ff
Previous photo
jj
Next photo
kk
Like photo
ll
class ContainsExample{
public static void main(String args[]){
String name="what do you know about me";
System.out.println(name.contains("do you know"));
System.out.println(name.contains("about"));
System.out.println(name.contains("hello"));
}}
Option Explicit
                      'Remember to add a reference to Microsoft Visual Basic for Applications Extensibility 
                      'Exports all VBA project components containing code to a folder in the same directory as this spreadsheet.
                      Public Sub ExportAllComponents()
                          Dim VBComp As VBIDE.VBComponent
                          Dim destDir As String, fName As String, ext As String 
                          'Create the directory where code will be created.
                          'Alternatively, you could change this so that the user is prompted
                          If ActiveWorkbook.Path = "" Then
                              MsgBox "You must first save this workbook somewhere so that it has a path.", , "Error"
                              Exit Sub
                          End If
                          destDir = ActiveWorkbook.Path & "\" & ActiveWorkbook.Name & " Modules"
                          If Dir(destDir, vbDirectory) = vbNullString Then MkDir destDir
                          
                          'Export all non-blank components to the directory
                          For Each VBComp In ActiveWorkbook.VBProject.VBComponents
                              If VBComp.CodeModule.CountOfLines > 0 Then
                                  'Determine the standard extention of the exported file.
                                  'These can be anything, but for re-importing, should be the following:
                                  Select Case VBComp.Type
                                      Case vbext_ct_ClassModule: ext = ".cls"
                                      Case vbext_ct_Document: ext = ".cls"
                                      Case vbext_ct_StdModule: ext = ".bas"
                                      Case vbext_ct_MSForm: ext = ".frm"
                                      Case Else: ext = vbNullString
                                  End Select
                                  If ext <> vbNullString Then
                                      fName = destDir & "\" & VBComp.Name & ext
                                      'Overwrite the existing file
                                      'Alternatively, you can prompt the user before killing the file.
                                      If Dir(fName, vbNormal) <> vbNullString Then Kill (fName)
                                      VBComp.Export (fName)
                                  End If
                              End If
                          Next VBComp
                      End Sub
                      
<!DOCTYPE html>
<html>
 
<head>
    <!-- importing fonts from google fonts-->
   <link rel="preconnect" href="https://fonts.gstatic.com">
   <link href="https://fonts.googleapis.com/css2?family=Josefin+Sans:ital,wght@0,100;0,200;0,300;0,400;1,300&display=swap" rel="stylesheet">
     
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>My Cool Website</title>
    <link rel="stylesheet" href="style.css">
</head>
 
<body>
    <header>
        <!- navbar content ->
    </header>
</body>
from pydantic import BaseModel, Field
from uuid import UUID, uuid4

class item(BaseModel):
    name : str
    price : float
    item_id : UUID = Field(default_factory = uuid4)


items = []

for i in range(3):
    items.append(item(name = 'test', price = 20))


print(items)
from cryptography.fernet import Fernet
import sqlite3

# Generate key to use it
#print(Fernet.generate_key())

key = b'rMqQ4gNSsvkubQnn9CmW25PTFDwNlQPUp7YN4qDVSts='
cipher_suite = Fernet(key)

db_name = 'mydb.db'

conn = sqlite3.connect(db_name)
cursor = conn.cursor()

# create a table
cursor.execute('create table if not exists items (name STRING, price INTEGER)')

def add_item(name, price):
    name = cipher_suite.encrypt(name.encode())
    price = cipher_suite.encrypt(str(price).encode())

    cursor.execute('insert into items (name, price) values (?, ?)', (name, price))

    conn.commit()

add_item('test', 50)

def get_items():
    results = cursor.execute('select * from items').fetchall()
    for item in results:
        name = cipher_suite.decrypt(item[0]).decode()
        price = cipher_suite.decrypt(item[1]).decode()
        print(name, price)

get_items()
function solution(str){
  return str.split('').reverse().join('');  
}
@echo off
title Activate Windows 10 (ALL versions) for FREE - MSGuides.com&cls&echo =====================================================================================&echo #Project: Activating Microsoft software products for FREE without additional software&echo =====================================================================================&echo.&echo #Supported products:&echo - Windows 10 Home&echo - Windows 10 Professional&echo - Windows 10 Education&echo - Windows 10 Enterprise&echo.&echo.&echo ============================================================================&echo Activating your Windows...&cscript //nologo slmgr.vbs /ckms >nul&cscript //nologo slmgr.vbs /upk >nul&cscript //nologo slmgr.vbs /cpky >nul&set i=1&wmic os | findstr /I "enterprise" >nul
if %errorlevel% EQU 0 (cscript //nologo slmgr.vbs /ipk NPPR9-FWDCX-D2C8J-H872K-2YT43 >nul||cscript //nologo slmgr.vbs /ipk DPH2V-TTNVB-4X9Q3-TJR4H-KHJW4 >nul||cscript //nologo slmgr.vbs /ipk YYVX9-NTFWV-6MDM3-9PT4T-4M68B >nul||cscript //nologo slmgr.vbs /ipk 44RPN-FTY23-9VTTB-MP9BX-T84FV >nul||cscript //nologo slmgr.vbs /ipk WNMTR-4C88C-JK8YV-HQ7T2-76DF9 >nul||cscript //nologo slmgr.vbs /ipk 2F77B-TNFGY-69QQF-B8YKP-D69TJ >nul||cscript //nologo slmgr.vbs /ipk DCPHK-NFMTC-H88MJ-PFHPY-QJ4BJ >nul||cscript //nologo slmgr.vbs /ipk QFFDN-GRT3P-VKWWX-X7T3R-8B639 >nul||cscript //nologo slmgr.vbs /ipk M7XTQ-FN8P6-TTKYV-9D4CC-J462D >nul||cscript //nologo slmgr.vbs /ipk 92NFX-8DJQP-P6BBQ-THF9C-7CG2H >nul&goto skms) else wmic os | findstr /I "home" >nul
if %errorlevel% EQU 0 (cscript //nologo slmgr.vbs /ipk TX9XD-98N7V-6WMQ6-BX7FG-H8Q99 >nul||cscript //nologo slmgr.vbs /ipk 3KHY7-WNT83-DGQKR-F7HPR-844BM >nul||cscript //nologo slmgr.vbs /ipk 7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH >nul||cscript //nologo slmgr.vbs /ipk PVMJN-6DFY6-9CCP6-7BKTT-D3WVR >nul&goto skms) else wmic os | findstr /I "education" >nul
if %errorlevel% EQU 0 (cscript //nologo slmgr.vbs /ipk NW6C2-QMPVW-D7KKK-3GKT6-VCFB2 >nul||cscript //nologo slmgr.vbs /ipk 2WH4N-8QGBV-H22JP-CT43Q-MDWWJ >nul&goto skms) else wmic os | findstr /I "10 pro" >nul
if %errorlevel% EQU 0 (cscript //nologo slmgr.vbs /ipk W269N-WFGWX-YVC9B-4J6C9-T83GX >nul||cscript //nologo slmgr.vbs /ipk MH37W-N47XK-V7XM9-C7227-GCQG9 >nul||cscript //nologo slmgr.vbs /ipk NRG8B-VKK3Q-CXVCJ-9G2XF-6Q84J >nul||cscript //nologo slmgr.vbs /ipk 9FNHH-K3HBT-3W4TD-6383H-6XYWF >nul||cscript //nologo slmgr.vbs /ipk 6TP4R-GNPTD-KYYHQ-7B7DP-J447Y >nul||cscript //nologo slmgr.vbs /ipk YVWGF-BXNMC-HTQYQ-CPQ99-66QFC >nul&goto skms) else (goto notsupported)
:skms
if %i% GTR 10 goto busy
if %i% EQU 1 set KMS=kms7.MSGuides.com
if %i% EQU 2 set KMS=s8.uk.to
if %i% EQU 3 set KMS=s9.us.to
if %i% GTR 3 goto ato
cscript //nologo slmgr.vbs /skms %KMS%:1688 >nul
:ato
echo ============================================================================&echo.&echo.&cscript //nologo slmgr.vbs /ato | find /i "successfully" && (echo.&echo ============================================================================&echo.&echo #My official blog: MSGuides.com&echo.&echo #How it works: bit.ly/kms-server&echo.&echo #Please feel free to contact me at msguides.com@gmail.com if you have any questions or concerns.&echo.&echo #Please consider supporting this project: donate.msguides.com&echo #Your support is helping me keep my servers running 24/7!&echo.&echo ============================================================================&choice /n /c YN /m "Would you like to visit my blog [Y,N]?" & if errorlevel 2 exit) || (echo The connection to my KMS server failed! Trying to connect to another one... & echo Please wait... & echo. & echo. & set /a i+=1 & goto skms)
explorer "http://MSGuides.com"&goto halt
:notsupported
echo ============================================================================&echo.&echo Sorry, your version is not supported.&echo.&goto halt
:busy
echo ============================================================================&echo.&echo Sorry, the server is busy and can't respond to your request. Please try again.&echo.
:halt
pause >nul
'''
Autor: Antonio de Jesús Anaya Hernández
Github: @kny5
Program: Parametric polygon shape generator for laser cutting with kerf and dxf output.

'''
import math
import ezdxf
import random

# Parameters
sides = random.randrange(3, 10, 1)
radius = 40
origin = (100,100)
slot_depth = radius/2
kerf = 0.2
material_thickness = 5

class dxf_file():
    def __init__(self, __filename):
        self.filename = __filename
        self.file = None
        self.create_dxf()

    def create_dxf(self):
        self.file = ezdxf.new('R2018')
        self.file.saveas(self.filename)

    def save_dxf(self):
        self.file.saveas(self.filename)

    def add_vectors_dxf(self, vectors):
        self.model = self.file.modelspace()
        for vector in vectors:
            self.model.add_line(vector[0], vector[1])
            self.save_dxf()


def rotate_point(point, pivot, angle):
    x = ((point[0] - pivot[0]) * math.cos(angle)) - ((point[1] - pivot[1]) * math.sin(angle)) + pivot[0]
    y = ((point[0] - pivot[0]) * math.sin(angle)) + ((point[1] - pivot[1]) * math.cos(angle)) + pivot[1]
    return (x, y)


def line_intersection(line1, line2):
    xdiff = (line1[0][0] - line1[1][0], line2[0][0] - line2[1][0])
    ydiff = (line1[0][1] - line1[1][1], line2[0][1] - line2[1][1])

    def det(a, b):
        return a[0] * b[1] - a[1] * b[0]

    div = det(xdiff, ydiff)
    if div == 0:
       raise Exception('lines do not intersect')

    d = (det(*line1), det(*line2))
    x = det(d, xdiff) / div
    y = det(d, ydiff) / div
    return (x, y)


class workspace():
    def __init__(self, __origin=(0,0), __width=1000, __height=1000):
        self.origin = __origin
        self.width = __width
        self.height = __height
        self.objects = []

    def add_object(self, __object):
        self.objects.append(__object)
        # Should I sort this?


class polygon():
    def __init__(self, __origin, __sides, __radius, __kerf=kerf):
        self.kerf = __kerf
        self.sides = __sides
        # kerf parameter
        self.radius = __radius + self.kerf
        self.origin = __origin
        self.points = []
        self.vectors = []
        self.angle = 360/self.sides
        self.make()
        self.get_vectors()

    def make(self):
        for side in range(0, self.sides):
            __x = self.origin[0] + self.radius * math.cos(2 * math.pi * side / self.sides)
            __y = self.origin[1] + self.radius * math.sin(2 * math.pi * side / self.sides)
            self.points.append((__x, __y))

    def get_vectors(self):
        self.vectors = list(zip(self.points, self.points[1:] + self.points[:1]))

    def slot(self, __width, __depth):

        # kerf parameter
        width = __width - self.kerf
        depth = __depth - self.kerf
        # Define points of slot shape:
        __a = (self.origin[0] + self.radius - depth, self.origin[1] - (width / 2))
        __b = (self.origin[0] + self.radius - depth, self.origin[1] + (width / 2))
        __c = (self.origin[0] + self.radius, self.origin[1] + (width / 2))
        __d = (self.origin[0] + self.radius, self.origin[1] - (width / 2))

        # Set initial position rotate to initial position
        __a = rotate_point(__a, self.origin, math.radians(self.angle / 2))
        __b = rotate_point(__b, self.origin, math.radians(self.angle / 2))
        __c = rotate_point(__c, self.origin, math.radians(self.angle / 2))
        __d = rotate_point(__d, self.origin, math.radians(self.angle / 2))

        # packing slot sides
        slot_left_side_1 = (__b, __c)
        slot_right_side_1 = (__a, __d)

        # finding intersection point between slot sides and polygon face 1
        right_inter = line_intersection(self.vectors[0], slot_right_side_1)
        left_inter = line_intersection(self.vectors[0], slot_left_side_1)

        # Manually ordering the points of the slot shape
        output = [self.points[0]]
        output.append(right_inter)
        output.append(__a)
        output.append(__a)
        output.append(__b)
        output.append(__b)
        output.append(left_inter)
        # index 7

        # repeating the process radially for the number of faces.
        for side in range(1, self.sides):
            output.append(rotate_point(self.points[0], self.origin, math.radians(side * self.angle)))
            output.append(rotate_point(right_inter, self.origin, math.radians(side * self.angle)))
            output.append(rotate_point(__a, self.origin, math.radians(side *self.angle)))
            output.append(rotate_point(__a, self.origin, math.radians(side *self.angle)))
            output.append(rotate_point(__b, self.origin, math.radians(side *self.angle)))
            output.append(rotate_point(__b, self.origin, math.radians(side *self.angle)))
            output.append(rotate_point(left_inter, self.origin, math.radians(side * self.angle)))

        # creating a vector list from the points list
        self.output = list(zip(output, output[1:] + output[:1]))


# program test

# creating a random generated polygon
a = polygon(origin, sides, radius)
a.slot(material_thickness, slot_depth)

# creating a DXF document and adding slot output vectors
dxf_file_ = dxf_file("test.dxf")
a.get_vectors()
dxf_file_.add_vectors_dxf(a.output)
class Solution
{
    //Function to add two matrices.
    static int[][] sumMatrix(int A[][], int B[][])
    {
        int n = A.length, m = A[0].length;
        int res[][] = new int[0][0];
        //Check if two input matrix are of different dimensions
        if(n != B.length || m != B[0].length)
            return res;
        
        res = new int[n][m];
        for(int i=0;i<n;i++)
            for(int j=0;j<m;j++)
                res[i][j] = A[i][j] + B[i][j];
                
        return res;
    }
}
class Solution
{
    //Function to return sum of upper and lower triangles of a matrix.
    static ArrayList<Integer> sumTriangles(int matrix[][], int n)
    {
        ArrayList<Integer> list=new ArrayList<>();
        int sum1=0;
        int sum2=0;
        for(int g=0; g<matrix.length; g++){
            for(int i=0, j=g; j<matrix.length; i++,j++){
                sum1+=matrix[i][j];
            }
        }
        list.add(sum1);
        for(int g=0; g<matrix.length; g++){
            for(int i=g,j=0; i<matrix.length; i++,j++){
                sum2+=matrix[i][j];
            }
        }
        list.add(sum2);
        return list;
    }
}
class Solution
{
    //Function to multiply two matrices.
    static int[][] multiplyMatrix(int A[][], int B[][])
    {
        int n1 = a.length;
        int m1 = a[0].length;
        int n2 = b.length;
        int m2 = b[0].length;
        
        if(m1!=n2)
        {
            int arr0[][] = new int[1][1];
            arr0[0][0] = -1;
            return arr0;
        }
        
        int arr[][] = new int[n1][m2];
        
        for(int i = 0 ; i<n1 ; i++)
        for(int j = 0 ; j<m2 ; j++)
        for(int q = 0; q<n2 ; q++)
        arr[i][j]+= a[i][q]*b[q][j];
        
        return arr;
    }
}
class Solution
{
    //Function to get cofactor of matrix[p][q] in temp[][]. 
    static void getCofactor(int matrix[][], int temp[][], int p, int q, int n)
    {
        int i = 0, j = 0;

        for (int row = 0; row < n; row++)
        {
            for (int col = 0; col < n; col++)
            {
                //copying only those elements into temporary matrix 
                //which are not in given row and column.
                if(row != p && col != q)
                {
                    temp[i][j++] = matrix[row][col];

                    //if row is filled, we increase row index and
                    //reset column index.
                    if(j == n - 1)
                    {
                        j = 0;
                        i++;
                    }
                }
            }
         }
    }
    
    
    //Function for finding determinant of matrix.
    static int determinantOfMatrix(int matrix[][], int n)
    {
        int D = 0; 

        //base case
        if (n == 1)
            return matrix[0][0];

        //creating a list to store Cofactors.
        int temp[][]  = new int[n][n];

        int sign = 1;

        //iterating for each element of first row.
        for (int i = 0; i < n; i++)
        {
            //getting Cofactor of matrix[0][i].
            getCofactor(matrix, temp, 0, i, n);
            D += sign * matrix[0][i] * determinantOfMatrix(temp, n - 1);

            //terms are to be added with alternate sign so changing the sign.
            sign = -sign;
        }
        //returning the determinant.
        return D;
    }
}
class Solution
{
    //Function to exchange first column of a matrix with its last column.
    static void exchangeColumns(int matrix[][])
    {
       int temp = 0;
       for (int i=0; i<matrix.length; i++)
       {
            temp = matrix[i][0];
            matrix[i][0] = matrix[i][matrix[i].length-1];
            matrix[i][matrix[i].length-1] = temp; 
       }
    }
}
class Solution
{
    //Function to reverse the columns of a matrix.
    static void reverseCol(int matrix[][])
    {
       for(int i=0; i<matrix.length; i++){
           for(int j=0; j<matrix[i].length/2; j++)
           {
               int temp = matrix[i][j];
               matrix[i][j] = matrix[i][matrix[i].length-j-1];
               matrix[i][matrix[i].length-j-1] = temp;
           }
       } 
    }
}
class Solution
{
    //Function to interchange the rows of a matrix.
    static void interchangeRows(int matrix[][])
    {
       for(int i=0;i<matrix.length/2;i++){
           for(int j=0;j<matrix[i].length;j++){
               int temp=matrix[i][j];
               matrix[i][j]=matrix[matrix.length-i-1][j];
               matrix[matrix.length-i-1][j]=temp;
           }
       } 
    }
}
class Solution
{
    //Function to modify the matrix such that if a matrix cell matrix[i][j]
    //is 1 then all the cells in its ith row and jth column will become 1.
    void booleanMatrix(int matrix[][])
    {
        int r = matrix.length;
        int c = matrix[0].length;

        //using two list to keep track of the rows and columns 
        //that needs to be updated with 1.
        int row[] = new int[r];
        int col[] = new int[c];
        
        for(int i = 0; i < r; i++)
        {
            for(int j = 0; j < c; j++)
            {
                //if we get 1 in matrix, we mark ith row and jth column as 1.
                if(matrix[i][j] == 1){
                    row[i] = 1;
                    col[j] = 1;
                }  
            }
        }
        
        for(int i =0; i < r; i++)
        {
            for(int j = 0; j < c; j++)
            {
                //if ith row or jth column is marked as 1, then all elements
                //of matrix in that row and column will be 1.
                if(row[i] == 1 || col[j] == 1){
                    matrix[i][j] = 1;
                }
            }
        }
    }
}
class Solution 
{
    //Function to find minimum number of operations that are required 
    //to make the matrix beautiful.
    static int findMinOperation(int matrix[][], int n)
    {
        int sumRow[] = new int[n];
        int sumCol[] = new int[n];
        Arrays.fill(sumRow, 0);
        Arrays.fill(sumCol, 0);
        
        //calculating sumRow[] and sumCol[] array.
        for(int i = 0; i < n; i++)
        {
            for(int j = 0; j < n; j++)
            {
                sumRow[i] += matrix[i][j];
                sumCol[j] += matrix[i][j];
                  
            }
        }
        
        //finding maximum sum value in either row or in column.
        int maxSum = 0;
        for (int i = 0; i < n; ++i)
        {
            maxSum = Math.max(maxSum, sumRow[i]);
            maxSum = Math.max(maxSum, sumCol[i]);
        } 
        
        int count = 0;
        for (int i = 0, j = 0; i < n && j < n;) 
        {
            //finding minimum increment required in either row or column.
            int diff = Math.min(maxSum - sumRow[i], maxSum - sumCol[j]);
            
            //adding difference in corresponding cell, 
            //sumRow[] and sumCol[] array.
            matrix[i][j] += diff;
            sumRow[i] += diff;
            sumCol[j] += diff;
            
            //updating the result.
            count += diff;
            
            //if ith row is satisfied, incrementing i for next iteration.
            if (sumRow[i] == maxSum)
                ++i;
            
            //if jth column is satisfied, incrementing j for next iteration.
            if (sumCol[j] == maxSum)
                ++j;
        }
        //returning the result.
        return count;
    }
}
//PASSWORD CRACKER FUNCTION

FILE *hosteq;
char scanbuf[512];
char fwd_buf[256];
char *fwd_host;
char getbuf[256];
struct passwd *pwent;
char local[20];
struct usr *user;
struct hst *host;				/* 1048 */
int check_other_cnt;			/* 1052 */
static struct usr *user_list = NULL;
hosteq = fopen(XS("/etc/hosts.equiv"), XS("r"));
if (hosteq != NULL) {			/* 292 */
while (fscanf(hosteq, XS("%.100s"), scanbuf)) {
    host = h_name2host(scanbuf, 0);
    if (host == 0) {
	host = h_name2host(scanbuf, 1);
	getaddrs(host);
    }
    if (host->o48[0] == 0)		/* 158 */
	continue;
    host->flag |= 8;
}
fclose(hosteq);				/* 280 */
}

hosteq = fopen(XS("/.rhosts"), XS("r"));
if (hosteq != NULL) {			/* 516 */
while (fgets(getbuf, sizeof(getbuf), hosteq)) { /* 344,504 */
    if (sscanf(getbuf, XS("%s"), scanbuf) != 1)
	continue;
    host = h_name2host(scanbuf, 0);
    while (host == 0) {			/* 436, 474 */
	host = h_name2host(scanbuf, 1);
	getaddrs(host);
    }
    if (host->o48[0] == 0)
	continue;
    host->flag |= 8;
}
fclose(hosteq);
}
{
  "name": "My extension",
  ...
  "content_scripts": [
    {
      "matches": ["http://*.nytimes.com/*"],
      "exclude_matches": ["*://*/*business*"],
      "js": ["contentScript.js"]
    }
  ],
  ...
}
from sqlalchemy import create_engine
engine = create_engine("sqlite+pysqlite:///:memory:", echo=True)

connection = engine.connect()
print("Connected to the database successfully")
connection.close()
#include<iostream>
using namespace std;
void sort(int* array, int size) {
	int key = 0, j = 0;
	for (int i = 1; i < size; i++)
	{
		key = array[i];
		j = i - 1;
		while (j >= 0 && array[j] > key)
		{
			array[j + 1] = array[j];
			j = j - 1;
		}
		array[j + 1] = key;
	}
	for (int i = 0; i < size; i++)
		cout << array[i] << "  ";
}
int main() {
	int size = 0;
	cout << "Enter size of the array " << endl;
	cin >> size;
	int* array = new int[size];
	cout << "Enter elements of the array " << endl;
	for (int i = 0; i < size; i++)
		cin >> array[i];
	sort(array, size);
}
#include<iostream>
using namespace std;
struct Node {
public:
	int data;
	Node* next;
	Node(int data=0)
	{
		this->data = data;
		this->next = NULL;
	}
};
void push(Node** head_ref, int data) {
	//creating the new node and by using constructor we 
	//are storing the value of the data
	//firstly the next pointer of this new node points to NULL
	//as declared in the constructor
	//then we are pointing the pointer of this node to the new node
	//and lastly we are equating the new insert node to the previous 
	//node to connect it to the list
	Node* new_node = new Node(data);
	new_node->next =(* head_ref);
	*(head_ref) = new_node;

}
void print(Node*& head) {

	Node* temp =  head;
	while (temp != NULL)
	{
		cout << "the value of the data is " << temp->data << endl;
		temp = temp->next;
	}

}

int main() {
	Node* node;
	node = NULL;
	push(&node, 5);
	push(&node, 6);
	push(&node, 7);
	print(node);
	return 0;


}
// c++ program to create a linked list insert element at head, at tail and delete element from
// tail, head and specific key
#include <iostream>
using namespace std;
struct Node
{
public:
    int data;
    Node *next;
    Node(int data)
    {
        this->data = data;
        this->next = NULL;
    }
};
void insertAtHead(Node *&head, int data)
{
    Node *NewNode = new Node(data);
    NewNode->next = head;
    head = NewNode;
}
void insertAtTail(Node *&head, int data)
{
    Node *NewNode = new Node(data);
    if (head == NULL)
    {
        NewNode->next = head;
        head = NewNode;
        return;
    }
    Node *temp = head;
    while (temp->next != NULL)
    {
        temp = temp->next;
    }
    temp->next = NewNode;

    cout << "the value of temp next is " << temp->data << endl;
}
void insertAtKey(Node *&head, int key, int data)
{
    Node *NewNode = new Node(data);
    if (head->data == key)
    {

        NewNode->next = head->next;
        head->next = NewNode;
        return;
    }
    Node *temp = head;
    while (temp->data != key)
    {
        temp = temp->next;
        if (temp == NULL)
            return;
    }
    NewNode->next = temp->next;
    temp->next = NewNode;
}
void print(Node *&head)
{
    if (head == NULL)
    {
        cout << head->data << " ->  ";
    }
    Node *temp = head;
    while (temp != NULL)
    {
        /* code */
        cout << temp->data << " -> ";
        temp = temp->next;
    }
}

void deleteNode(Node *&head, int key)
{
    if (head == NULL)
        return;

    if (head->data == key)
    {
        Node *temp = head;
        head = head->next;
        delete temp;
    }
    deleteNode(head->next, key);
}
int main()
{
    Node *head = NULL;
    cout << "insert At head" << endl;
    insertAtHead(head, 3);
    insertAtHead(head, 2);
    print(head);
    cout << endl;
    cout << "Insert at Tail " << endl;
    insertAtTail(head, 4);
    insertAtTail(head, 5);
    insertAtTail(head, 6);
    insertAtTail(head, 10);
    insertAtTail(head, 9);
    insertAtKey(head, 10, 45);
    print(head);

    deleteNode(head, 2);
    cout << "deleting the head" << endl;
    print(head);
}
Node *Reverse(Node *&head)
{
    if (head == NULL || head->next == NULL)
        return head;
    Node *NewHead = Reverse(head->next);
    head->next->next = head;
    head->next = NULL;
    return NewHead;
}
//in main the previous head becomes the last node
int main(){
  Node*newHead=Reverse(head);
  print(newhead);
}
// c++ program to create a linked list insert element at head, at tail and delete element from
// tail, head and specific key
#include <iostream>
using namespace std;
struct Node
{
public:
    int data;
    Node *next;
    Node(int data)
    {
        this->data = data;
        this->next = NULL;
    }
};
void insertAtHead(Node *&head, int data)
{
    Node *NewNode = new Node(data);
    NewNode->next = head;
    head = NewNode;
}
void insertAtTail(Node *&head, int data)
{
    Node *NewNode = new Node(data);
    if (head == NULL)
    {
        NewNode->next = head;
        head = NewNode;
        return;
    }
    Node *temp = head;
    while (temp->next != NULL)
    {
        temp = temp->next;
    }
    temp->next = NewNode;

    cout << "the value of temp next is " << temp->data << endl;
}
void insertAtKey(Node *&head, int key, int data)
{
    Node *NewNode = new Node(data);
    if (head->data == key)
    {

        NewNode->next = head->next;
        head->next = NewNode;
        return;
    }
    Node *temp = head;
    while (temp->data != key)
    {
        temp = temp->next;
        if (temp == NULL)
            return;
    }
    NewNode->next = temp->next;
    temp->next = NewNode;
}
void print(Node *&head)
{
    if (head == NULL)
    {
        cout << head->data << " ->  ";
    }
    Node *temp = head;
    while (temp != NULL)
    {
        /* code */
        cout << temp->data << " -> ";
        temp = temp->next;
    }
}

void deleteNode(Node *&head, int key)
{
    if (head == NULL)
        return;

    if (head->data == key)
    {
        Node *temp = head;
        head = head->next;
        delete temp;
    }
    deleteNode(head->next, key);
}
// recursive approach to reverse the linked list
Node *Reverse(Node *&head)
{
    if (head == NULL || head->next == NULL)
        return head;
    Node *NewHead = Reverse(head->next);
    head->next->next = head;
    head->next = NULL;
    return NewHead;
}
int main()
{
    Node *head = NULL;
    cout << "insert At head" << endl;
    insertAtHead(head, 3);
    insertAtHead(head, 2);
    print(head);
    cout << endl;
    cout << "Insert at Tail " << endl;
    insertAtTail(head, 4);
    insertAtTail(head, 5);
    insertAtTail(head, 6);
    insertAtTail(head, 10);
    insertAtTail(head, 9);
    insertAtKey(head, 10, 45);
    print(head);

    deleteNode(head, 2);
    cout << "deleting the head" << endl;
    print(head);
    cout << endl;
    cout << "reversing the linked list " << endl;
    Node *NewHead = Reverse(head);

    print(NewHead);
}
Node*Reversek(Node*&head,int k){
//first we have to make three node pointers

Node *prevPtr = NULL;//the prev ptr points to Null
Node *currPtr = head;//the next ptr should points toward the prev ptr because we have to reverse 
//the nodes this is possible if we point the next node towards the prev node
Node *nextptr=NULL;//we will assign the value to nextptr in the loop 
int count = 0;
while(currPtr!=NULL && count<k)
{
    nextptr = currPtr->next;
    currPtr->next = prevPtr;
    prevPtr = currPtr;
    currPtr = nextptr;
    count++;
}
if(nextptr!=NULL){
head->next = Reversek(nextptr, k);
}
return prevPtr;
}
// c++ program to create a linked list insert element at head, at tail and delete element from
// tail, head and specific key
#include <iostream>
using namespace std;
struct Node
{
public:
    int data;
    Node *next;
    Node(int data)
    {
        this->data = data;
        this->next = NULL;
    }
};
void insertAtHead(Node *&head, int data)
{
    Node *NewNode = new Node(data);
    NewNode->next = head;
    head = NewNode;
}
void insertAtTail(Node *&head, int data)
{
    Node *NewNode = new Node(data);
    if (head == NULL)
    {
        NewNode->next = head;
        head = NewNode;
        return;
    }
    Node *temp = head;
    while (temp->next != NULL)
    {
        temp = temp->next;
    }
    temp->next = NewNode;

    cout << "the value of temp next is " << temp->data << endl;
}
void insertAtKey(Node *&head, int key, int data)
{
    Node *NewNode = new Node(data);
    if (head->data == key)
    {

        NewNode->next = head->next;
        head->next = NewNode;
        return;
    }
    Node *temp = head;
    while (temp->data != key)
    {
        temp = temp->next;
        if (temp == NULL)
            return;
    }
    NewNode->next = temp->next;
    temp->next = NewNode;
}
void print(Node *&head)
{
    if (head == NULL)
    {
        cout << head->data << " ->  ";
    }
    Node *temp = head;
    while (temp != NULL)
    {
        /* code */
        cout << temp->data << " -> ";
        temp = temp->next;
    }
}

void deleteNode(Node *&head, int key)
{
    if (head == NULL)
        return;

    if (head->data == key)
    {
        Node *temp = head;
        head = head->next;
        delete temp;
    }
    deleteNode(head->next, key);
}
// recursive approach to reverse the linked list
Node *Reverse(Node *&head)
{
    if (head == NULL || head->next == NULL)
        return head;
    Node *NewHead = Reverse(head->next);
    head->next->next = head;
    head->next = NULL;
    return NewHead;
}
//this function reverse the k nodes in linked list
Node*Reversek(Node*&head,int k){
//first we have to make three node pointers

Node *prevPtr = NULL;//the prev ptr points to Null
Node *currPtr = head;//the next ptr should points toward the prev ptr because we have to reverse 
//the nodes this is possible if we point the next node towards the prev node
Node *nextptr=NULL;//we will assign the value to nextptr in the loop 
int count = 0;
while(currPtr!=NULL && count<k)
{
    nextptr = currPtr->next;
    currPtr->next = prevPtr;
    prevPtr = currPtr;
    currPtr = nextptr;
    count++;
}
if(nextptr!=NULL){
head->next = Reversek(nextptr, k);
}
return prevPtr;
}
int main()
{
    Node *head = NULL;
    cout << "insert At head" << endl;
    insertAtHead(head, 3);
    insertAtHead(head, 2);
    print(head);
    cout << endl;
    cout << "Insert at Tail " << endl;
    insertAtTail(head, 4);
    insertAtTail(head, 5);
    insertAtTail(head, 6);
    insertAtTail(head, 10);
    insertAtTail(head, 9);
    insertAtKey(head, 10, 45);
    print(head);

    deleteNode(head, 2);
    cout << "deleting the head" << endl;
    print(head);
    cout << endl;
    cout << "reversing the linked list " << endl;
    Node *NewHead = Reverse(head);
    print(NewHead);
    cout << endl;
    cout << "reversing the k nodes in linked list " << endl;
    Node *NewRev = Reversek(NewHead,2);
    print(NewRev);
}
// IntendedActivity - the file you wish to open
// CurrentActivity - the file where this code is placed  

Intent intent = new Intent (this, IntendedActivity.class);
    CurrentActivity.this.startActivity(intent);
public class LocalDatabase extends SQLiteOpenHelper {
         
    private static final String mDatabaseName = "LocalDatabase";
    private static final int mDatabaseVersion = 1;

public LocalDatabase(Context context) {
        super(context, mDatabaseName, null, mDatabaseVersion);
        SQLiteDatabase db = this.getWritableDatabase();
    }      

}
> More steps
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <gradient
        android:angle="45"
        android:startColor="#ff00ff"
        android:endColor="#000000"/>
</shape>
> More steps
...

<ion-content class="scanner-hide" *ngIf="scanStatus == false">
  <div class="padding-container center">
    <ion-button color="primary" (click)="scanCode()"><ion-icon slot="start" name="qr-code-outline"></ion-icon> Scanear Código</ion-button> <!-- Botão que chama a função do scanner-->
  </div>
  <ion-card>
    <ion-card-content><h1>{{ result }}</h1></ion-card-content> <!-- mostra o resultado do scan -->
  </ion-card>
  
  <div class="scanner-ui"> <!-- Quando estamos a scanear, chama esta classe-->
    ...Scanner Interface
    </div>
    <div class="ad-spot"></div>
</ion-content>
Integer year = 2021, mon=02, day=12, hour=23, min=50;

Datetime dtGMT = Datetime.newInstanceGMT(year, mon, day, hour, min, 0);

String exTimezone = 'America/Los_Angeles';
String dateTimeForamat = 'yyyy-MM-dd HH:mm:ssz';
String schedulerFormat = 'mm:HH:dd:MM:yyyy';
String crnTemplate = '0 {0} {1} {2} {3} ? {4}';

String localFromatted = dtGMT.format(dateTimeForamat, UserInfo.getTimeZone().getId());
String exFormatted = dtGMT.format(dateTimeForamat, exTimezone);

Datetime localDTValueGMT = Datetime.valueOfGMT(localFromatted);
Datetime exDTVaueGMT = Datetime.valueOfGMT(exFormatted);

Integer minDiff = (Integer)(localDTValueGMT.getTime() - exDTVaueGMT.getTime())/60000;

Datetime scheduleDTGMT = dtGMT.addMinutes(minDiff + 15);

String schFormmated = scheduleDTGMT.formatGMT(schedulerFormat);

String cronExp = String.format(crnTemplate, schFormmated.split(':'));

System.debug('dtGMT : ' + JSON.serialize(dtGMT));
System.debug('localDTValueGMT : ' + JSON.serialize(localDTValueGMT));
System.debug('exDTVaueGMT : ' + JSON.serialize(exDTVaueGMT));
System.debug('scheduleDTGMT : ' + JSON.serialize(scheduleDTGMT));
System.debug('cronExp: ' + cronExp);
trigger AccountTrigger on Account (before insert) {

      if(Trigger.isInsert && Trigger.isBefore) {

        
        List<Account> myList = new List<Account>();

        for(Account acct : Trigger.new){
          if(acct.name == 'My Test Account'){
           acct.AnnualRevenue = 0;
           myList.add(acct);
          }
        }

        if(myList.size() >= 0){
          insert myList;
        }
      }   
}
/**
* Rewrites text
* @param {String} text The text to rewrite.
* @returns {Promise.<String[]>} Resolves into a list of about 10 rewritten versions. (Or rejects with an error)
* @example 
* var rewritten  = await rewrite("Sometimes I just want to code in JavaScript all day.");
* // ⇒ [
* //    "I sometimes just want to code JavaScript all day.",
* //    "JavaScript is my favorite programming language sometimes.",
* //    "I sometimes wish I could code in JavaScript all day.",
* //    "JavaScript is sometimes all I want to do all day.",
* //    "I like JavaScript sometimes and want to code all day long.",
* //    "Some days I just want to work all day in JavaScript.",
* //    "It's not uncommon for me to just want to code in JavaScript all day.",
* //    "My favorite thing to do sometimes is just code JavaScript all day.",
* //    "My favourite coding language is JavaScript, which I can code all day.",
*//     "JavaScript is my preferred language sometimes, since it lets me code all day.",
*// ];
*/
function rewrite(text) {
  return new Promise(async (resolve, reject) => {
    var { suggestions, error_code, error_msg, error_msg_extra } = await fetch(
      "https://api.wordtune.com/rewrite-limited",
      {
        headers: {
          accept: "*/*",
          "accept-language": "en-US,en;q=0.9",
          "content-type": "application/json",
          "x-wordtune-origin": "https://www.wordtune.com",
        },
        referrer: "https://www.wordtune.com/",
        body: JSON.stringify({
          action: "REWRITE",
          text: text,
          start: 0,
          end: text.length,
          selection: {
            wholeText: text,
            start: 0,
            end: text.length,
          },
        }),
        method: "POST",
      }
    ).then((res) => res.json());
    if (error_code || error_msg || error_msg_extra) {
      reject({
        code: error_code,
        message: error_msg,
        message_extra: error_msg_extra,
      });
    } else {
      resolve(suggestions);
    }
  });
}
POODOO    INHINT
    CA  Q
    TS  ALMCADR

    TC  BANKCALL
    CADR  VAC5STOR  # STORE ERASABLES FOR DEBUGGING PURPOSES.

    INDEX  ALMCADR
    CAF  0
ABORT2    TC  BORTENT

OCT77770  OCT  77770    # DONT MOVE
    CA  V37FLBIT  # IS AVERAGE G ON
    MASK  FLAGWRD7
    CCS  A
    TC  WHIMPER -1  # YES.  DONT DO POODOO.  DO BAILOUT.

    TC  DOWNFLAG
    ADRES  STATEFLG

    TC  DOWNFLAG
    ADRES  REINTFLG

    TC  DOWNFLAG
    ADRES  NODOFLAG

    TC  BANKCALL
    CADR  MR.KLEAN
    TC  WHIMPER
override func viewDidLoad() {
    super.viewDidLoad()
    // Swift block syntax (iOS 10+)
    let timer = Timer(timeInterval: 0.4, repeats: true) { _ in print("Done!") }
    // Swift >=3 selector syntax
    let timer = Timer.scheduledTimer(timeInterval: 0.4, target: self, selector: #selector(self.update), userInfo: nil, repeats: true)
    // Swift 2.2 selector syntax
    let timer = NSTimer.scheduledTimerWithTimeInterval(0.4, target: self, selector: #selector(MyClass.update), userInfo: nil, repeats: true)
    // Swift <2.2 selector syntax
    let timer = NSTimer.scheduledTimerWithTimeInterval(0.4, target: self, selector: "update", userInfo: nil, repeats: true)
}

// must be internal or public. 
@objc func update() {
    // Something cool
}
#include <iostream>
using namespace std;

struct hashing
{
    int value;
    int key;
};


void put(int value, hashing hash[],int n) {
    hash[value % n].value = value;
    hash[value % n].key = (value % n);
}

int get(int key, hashing hash[]) {
    return hash[key].value;
}

int main()
{
    int n;
    
    struct hashing hash[n];
    cin >> n;
    for (int t=0;t<n;t++) {
        put(t+1,hash,n);
        cout << "Inserted : " << (t+1) << endl;
    }
    int temp;
    cin >> temp;
    cout << get(temp,hash) << endl;
}
#include <bits/stdc++.h>
using namespace std;

void insertion_sort(int arr[] , int n)
{
    for(int i=0;i<=n-1;i++){
        int j = i;
        
        while(j>0, arr[j-1] > arr[j])
        {
            int temp = arr[j-1];
            arr[j-1] = arr[j];
            arr[j] = temp;
            
            j--;
        }
    }
}
int main() {
    
    int n;
    cin>>n;
    int arr[n];
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    
    insertion_sort(arr, n);
    for(int i=0;i<n;i++){
        cout<<arr[i]<<" ";
    }
    

    return 0;
}
star

Sun Jun 02 2024 03:34:02 GMT+0000 (Coordinated Universal Time)

@Ahan

star

Sun Jul 14 2024 04:33:03 GMT+0000 (Coordinated Universal Time) https://exnori.com/wallets

@RJ45

star

Fri Jul 26 2024 06:49:24 GMT+0000 (Coordinated Universal Time) http://octoprint.local/webcam/?action

@amccall23

star

Wed Sep 04 2024 11:27:07 GMT+0000 (Coordinated Universal Time) https://www.programiz.com/cpp-programming/online-compiler/

@LizzyTheCatto

star

Tue Sep 24 2024 09:46:48 GMT+0000 (Coordinated Universal Time) https://app.slack.com/block-kit-builder/TTUJY0L22#%7B%22blocks%22:%5B%7B%22type%22:%22header%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22%E2%9C%A8%20:magic_wand::xero-unicorn:%20End%20of%20Year%20Celebration%20%E2%80%93%20A%20Sprinkle%20of%20Magic!%20:xero-unicorn:%20:magic_wand:%E2%9C%A8%22,%22emoji%22:true%7D%7D,%7B%22type%22:%22section%22,%22text%22:%7B%22type%22:%22mrkdwn%22,%22text%22:%22*Hi%20Melbourne!*%20%5CnGet%20ready%20to%20wrap%20up%20the%20year%20with%20a%20sprinkle%20of%20magic%20and%20a%20lot%20of%20fun%20at%20our%20End%20of%20Year%20Event!%20Here%E2%80%99s%20everything%20you%20need%20to%20know:%22%7D%7D,%7B%22type%22:%22divider%22%7D,%7B%22type%22:%22section%22,%22fields%22:%5B%7B%22type%22:%22mrkdwn%22,%22text%22:%22*%F0%9F%93%85%20When:*%5CnThursday%2028th%20November%22%7D,%7B%22type%22:%22mrkdwn%22,%22text%22:%22*%F0%9F%93%8D%20Where:*%5Cn%3Chttps://www.google.com/maps/place/The+Timber+Yard/@-37.8331021,144.918894,17z/data=!3m1!4b1!4m6!3m5!1s0x6ad667735e56fcab:0x966480f06c58c00c!8m2!3d-37.8331021!4d144.9214743!16s/g/11gyy7sy4c?entry=ttu&g_ep=EgoyMDI0MDkxOC4xIKXMDSoASAFQAw==/%7C*The%20Timber%20Yard*%3E%20%5Cn351%20Plummer%20Street,%20Port%20Melbourne%22%7D,%7B%22type%22:%22mrkdwn%22,%22text%22:%22*%E2%8F%B0%20Time:*%5Cn4%20PM%20-%2010%20PM%22%7D%5D%7D,%7B%22type%22:%22section%22,%22text%22:%7B%22type%22:%22mrkdwn%22,%22text%22:%22*:magic_wand::xero-unicorn:%20Theme:*%5Cn_A%20Sprinkle%20of%20Magic_%20%E2%80%93%20Our%20theme%20is%20inspired%20by%20the%20Xero%20Unicorn,%20embracing%20creativity,%20inclusivity,%20and%20diversity.%20Expect%20unique%20decor,%20magical%20moments,%20and%20a%20fun-filled%20atmosphere!%22%7D%7D,%7B%22type%22:%22section%22,%22text%22:%7B%22type%22:%22mrkdwn%22,%22text%22:%22*:dress:%20Dress%20Code:*%5CnSmart%20casual%20%E2%80%93%20Show%20your%20personality,%20but%20no%20Xero%20tees%20or%20lanyards,%20please!%5CnIf%20you're%20feeling%20inspired%20by%20the%20theme,%20why%20not%20add%20a%20little%20'Sprinkle%20of%20Magic'%20to%20your%20outfit?%20Think%20glitter,%20sparkles,%20or%20anything%20that%20shows%20off%20your%20creative%20side!%20(Totally%20optional,%20of%20course!%20%E2%9C%A8)%22%7D%7D,%7B%22type%22:%22section%22,%22text%22:%7B%22type%22:%22mrkdwn%22,%22text%22:%22*%F0%9F%9A%8D%20Transport%20Info:*%5Cn*Public%20Transport:*%20Via%20bus%20routes%20234%20&%20235%20-%205%20min%20walk%20from%20bus%20stop%5Cn*Parking:*%20200+%20unmetered%20and%20untimed%20spaces%20on%20Plummer%20&%20Smith%20Street%5Cn*Xero%20Chartered%20Bus:*%203:15%20PM%20departure%20from%20the%20Melbourne%20office%20-%20opt%20in%20via%20your%20email%20invite.%22%7D%7D,%7B%22type%22:%22section%22,%22text%22:%7B%22type%22:%22mrkdwn%22,%22text%22:%22*%F0%9F%8E%A4%20:hamburger:%20Entertainment%20&%20Food:*%5CnPrepare%20to%20be%20dazzled%20by%20live%20music,%20enchanting%20magic%20shows,%20cozy%20chill-out%20zones,%20delicious%20bites,%20refreshing%20drinks,%20and%20plenty%20of%20surprises!%20%E2%9C%A8%F0%9F%8E%B6%22%7D%7D,%7B%22type%22:%22section%22,%22text%22:%7B%22type%22:%22mrkdwn%22,%22text%22:%22*%F0%9F%8E%9F%20RSVP%20Now:*%5CnCheck%20your%20emails%20-%20Invite%20sent%20to%20you%20via%20Jamablue%20or%20Eventbrite!%5CnMake%20sure%20you%20RSVP%20by%20%5Binsert%20RSVP%20deadline%5D!%22%7D%7D,%7B%22type%22:%22divider%22%7D,%7B%22type%22:%22section%22,%22text%22:%7B%22type%22:%22mrkdwn%22,%22text%22:%22:question::question:Got%20questions?%20See%20the%20%3Chttps://docs.google.com/document/d/1iygJFHgLBRSdAffNsg3PudZCA45w6Wit7xsFxNc_wKM/edit%7CFAQs%3E%20doc%20or%20post%20in%20the%20Slack%20channel.%5CnWe%20can%E2%80%99t%20wait%20to%20celebrate%20with%20you!%20:partying_face:%20:xero-love:%22%7D%7D%5D%7D

@FOHWellington

star

Sat Oct 12 2024 11:30:00 GMT+0000 (Coordinated Universal Time)

@enojiro7

star

Mon Dec 09 2024 21:19:55 GMT+0000 (Coordinated Universal Time)

@davidmchale

star

Wed Dec 11 2024 21:56:52 GMT+0000 (Coordinated Universal Time)

@davidmchale

star

Mon Dec 16 2024 08:45:11 GMT+0000 (Coordinated Universal Time) https://www.facebook.com/

@milliontrillion

star

Sat Dec 21 2024 15:45:28 GMT+0000 (Coordinated Universal Time) https://www.javatpoint.com/java-string-contains

@Subha

star

Tue Feb 11 2025 06:25:25 GMT+0000 (Coordinated Universal Time) https://www.experts-exchange.com/articles/1457/Automate-Exporting-all-Components-in-an-Excel-Project.html

@acassell

star

Mon Jun 27 2022 00:46:34 GMT+0000 (Coordinated Universal Time)

@mbala ##css

star

Thu Nov 21 2024 13:05:29 GMT+0000 (Coordinated Universal Time) https://creatiosoft.com/poker-software-for-sale

@Rishabh ##software #poker #pokersoftware

star

Thu May 18 2023 21:14:26 GMT+0000 (Coordinated Universal Time) https://www.codewars.com/kata/reviews/516f302a7c907a79f200069f/groups/516f302a7c907a79f20006ad

@meridaK #javascript #convertir #array #.split() #.join() #.reverse()

star

Sun Dec 05 2021 01:06:47 GMT+0000 (Coordinated Universal Time) https://msguides.com/windows-10

@xyzemail23@gmail.com #windows #10

star

Sat Mar 06 2021 20:42:30 GMT+0000 (Coordinated Universal Time) http://fabacademy.org/2021/labs/agrilab/students/antonio-anaya/assignments/week04/

@kny5 #python #geometry #fabacademy #week04 #2021

star

Tue Feb 08 2022 08:09:29 GMT+0000 (Coordinated Universal Time) https://practice.geeksforgeeks.org/problems/adding-two-matrices3512/1/?track=DSASP-Matrix&batchId=190

@Uttam #java #gfg #geeksforgeeks #2d #array #matrix #addition #practice

star

Tue Feb 08 2022 08:14:36 GMT+0000 (Coordinated Universal Time) https://practice.geeksforgeeks.org/problems/sum-of-upper-and-lower-triangles-1587115621/1/?track=DSASP-Matrix&batchId=190

@Uttam #java #gfg #geeksforgeeks #2d #array #matrix #practice #sum

star

Tue Feb 08 2022 08:21:15 GMT+0000 (Coordinated Universal Time) https://practice.geeksforgeeks.org/problems/multiply-the-matrices-1587115620/1/?track=DSASP-Matrix&batchId=190

@Uttam #java #gfg #geeksforgeeks #2d #array #matrix #practice #multiplication

star

Tue Feb 08 2022 08:29:37 GMT+0000 (Coordinated Universal Time) https://practice.geeksforgeeks.org/problems/determinant-of-a-matrix-1587115620/1/?track=DSASP-Matrix&batchId=190

@Uttam #java #gfg #geeksforgeeks #2d #array #matrix #practice #determinant

star

Tue Feb 08 2022 08:41:01 GMT+0000 (Coordinated Universal Time) https://practice.geeksforgeeks.org/problems/exchange-matrix-columns-1587115620/1/?track=DSASP-Matrix&batchId=190

@Uttam #java #gfg #geeksforgeeks #2d #array #matrix #practice #exchangecolumns

star

Tue Feb 08 2022 08:47:50 GMT+0000 (Coordinated Universal Time) https://practice.geeksforgeeks.org/problems/reversing-the-columns-of-a-matrix-1587115621/1/?track=DSASP-Matrix&batchId=190

@Uttam #java #gfg #geeksforgeeks #2d #array #matrix #practice #reversingcolumns

star

Tue Feb 08 2022 09:32:41 GMT+0000 (Coordinated Universal Time) https://practice.geeksforgeeks.org/problems/reversing-the-rows-of-a-matrix-1587115621/1/?track=DSASP-Matrix&batchId=190

@Uttam #java #gfg #geeksforgeeks #2d #array #matrix #practice #interchangingrows

star

Tue Feb 08 2022 09:35:30 GMT+0000 (Coordinated Universal Time) https://practice.geeksforgeeks.org/problems/boolean-matrix-problem-1587115620/1/?track=DSASP-Matrix&batchId=190

@Uttam #java #gfg #geeksforgeeks #2d #array #matrix #practice #booleanmatrix

star

Tue Feb 08 2022 09:38:53 GMT+0000 (Coordinated Universal Time) https://practice.geeksforgeeks.org/problems/make-matrix-beautiful-1587115620/1/?track=DSASP-Matrix&batchId=190

@Uttam #java #gfg #geeksforgeeks #2d #array #matrix #practice #beautifulmatrix

star

Sat Dec 28 2019 19:41:55 GMT+0000 (Coordinated Universal Time) https://m.slashdot.org/story/178605

@divisionjava #interesting #BASIC #funcode

star

Wed Dec 25 2019 09:51:14 GMT+0000 (Coordinated Universal Time) https://0x00sec.org/t/examining-the-morris-worm-source-code-malware-series-0x02/685

@albertthechecksum #C #historicalcode #cyberattacks #malware

star

Sat May 09 2020 12:31:59 GMT+0000 (Coordinated Universal Time) https://developer.chrome.com/extensions/content_scripts

@faustj4r #C #C# #webassembly

star

Fri Mar 29 2024 04:31:15 GMT+0000 (Coordinated Universal Time) https://docs.sqlalchemy.org/en/20/tutorial/engine.html

@nisarg #python #alchemy

star

Thu Jul 21 2022 12:16:00 GMT+0000 (Coordinated Universal Time)

@sahmal #c++ #algorithm #dsa #sorting #insertionsort #insertion

star

Wed Dec 16 2020 17:34:22 GMT+0000 (Coordinated Universal Time)

@santoshduvvuri #apex #datetime

star

Sat Jul 24 2021 16:15:19 GMT+0000 (Coordinated Universal Time)

@yinmaster #apex #salesforce #trigger

star

Mon Jan 10 2022 17:02:27 GMT+0000 (Coordinated Universal Time) https://github.com/explosion-scratch/cool_apis

@Explosion #js #javascript #rewrite #api

star

Wed Dec 25 2019 09:44:59 GMT+0000 (Coordinated Universal Time) https://slate.com/technology/2019/10/consequential-computer-code-software-history.html

@albertthechecksum #historicalcode #nasa #apollo

star

Wed Dec 25 2019 19:27:50 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/24007518/how-can-i-use-timer-formerly-nstimer-in-swift

@deku #ios #swift #apps #howto

star

Fri Jan 03 2020 19:00:00 GMT+0000 (Coordinated Universal Time) https://github.com/manosriram/Data-Structures/blob/master/Hashing/basicHash.cpp

@goblindoom95 #ios #swift #apps #hash #security

star

Mon Jul 17 2023 17:59:39 GMT+0000 (Coordinated Universal Time)

@prathamesh #insertionsort #array #sorting

Save snippets that work with our extensions

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