Snippets Collections
def minion_game(string):
    vowels = 'AEIOU'
    k,s = 0,0
    l =len(string)
    for i in range(l):
        if string[i] in vowels:
            k += (l-i)
        else:
            s += (l-i)
    if k > s:
        print("Kevin", k)
    elif k < s:
        print("Stuart", s)
    else:
        print("Draw")

if __name__ == '__main__':
    s = input()
    minion_game(s)
#Chance
import random

# Welcome message
print("Hello, Traveler! What is your name?")

# Get username
username = input("Enter username: ")

# Greet the user
print(f"Hello, {username}!")

# Introduce the quest
print("You are on your way to get the legendary cookie.")

# Present weapon choices
print("What weapon will you start with?")
print("A: Blade of Power ( 50 DMG, 25% CRIT RATE = 75 DMG)")
print("B: Katana of Wisdom (35 DMG, 50% CRIT RATE = 52.5 DMG)")

# Get user's choice
while True:
    choice = input("Choose your weapon (A/B): ").strip().upper()
    if choice not in ["A", "B"]:
        print("Invalid choice. Please choose A or B.")
    else:
        break

# Process user's choice
if choice == "A":
    print("You chose Blade of Power!")
    weapon = "Blade of Power"
    damage = 50
    crit_rate = 0.25
elif choice == "B":
    print("You chose Katana of Wisdom!")
    weapon = "Katana of Wisdom"
    damage = 35
    crit_rate = 0.5

#Variables
gremlin_hp = 70
monster = "gremlin"
damage2 = 40
crit_rate2 = 0.5
player_HP = 100
gremlindead = 0
# Encounter a gremlin
print("You encounter a gremlin that eats people's socks! (it has {} HP)".format(gremlin_hp))
print("What do you do?")

# Present choices
print("A: Kill it")
print("B: Befriend it (50% chance) (+30 ATK)")

# Get user's choice
while True:
    choice = input("Choose your action (A/B): ").strip().upper()
    if choice not in ["A", "B"]:
        print("Invalid choice. Please choose A or B.")
    else:
        break

# Process user's choice
if choice == "A":
    # Kill the gremlin
    print("You attack the gremlin with your {}!".format(weapon))
    
    # Roll for crit
    if random.random() < crit_rate:
        damage *= 1.5
        print("Critical hit!")
    print("You deal {} damage to the gremlin!".format(damage))
    gremlin_hp -= damage
    if gremlin_hp <= 0:
        print("The gremlin is defeated!")
        gremlindead = 1  
    else:
        print("But the gremlin isn't dead yet!")
        print("The gremlin has {} HP remaining!".format(gremlin_hp))
        print("You're attacked by the {}!".format(monster))
        print("You have {} HP left!".format(player_HP - damage2))
        print("What will you do?")
# Present choices
print("A: Attack it")
print("B: Befriend it (30% chance) (+40 ATK)")
print("C: Flee")

#Get user's choice A
choice = input("Choose your action (A/B/C): ").strip().upper()
if choice not in ["A", "B", "C"]:
    print("Invalid choice. Please choose between A, B, or C.")

if choice == "A":
    # Kill the gremlin
    print("You attack the gremlin with your {}!".format(weapon))
        
        # Roll for crit
if random.random() < crit_rate:
        damage *= 1.5
        print("Critical hit!")
        print("You deal {} damage to the gremlin!".format(damage))
        gremlin_hp -= damage
        if gremlin_hp <= 0:
            print("The gremlin is defeated!")
        print("Your attack power increases by {}!".format(damage2))

if choice == "B":
    # Befriend the gremlin
    if random.random() < 0.5:
        print("You successfully befriend the gremlin!")
        print("Your attack power increases by {}!".format(damage2))

if choice == "C":
    #Flee
    print("You ran away!, but, you fell into a pit of lava and died. Gme Over :(((")
    exit()

def print_formatted(number):
    width = len(bin(number)[2:])
    for i in range(1, number+1):
        deci = str(i)
        octa = oct(i)[2:]
        hexa = hex(i)[2:].upper()
        bina = bin(i)[2:]
        print(deci.rjust(width),octa.rjust(width),hexa.rjust(width),bina.rjust(width))
    # your code goes here

if __name__ == '__main__':
    n = int(input())
    print_formatted(n)
class Solution {
    public static ArrayList<ArrayList<Integer>> Paths(Node root) {
        // code here
        
        ArrayList<ArrayList<Integer>> result = new ArrayList<>();
        
        pathToLeaf(root,result,new ArrayList<>());
        
        return result;
    }
    
    
    private  static void pathToLeaf(Node node, List<ArrayList<Integer>> result, ArrayList<Integer> sub){
        if(node == null){
            return;
        }
        
        sub.add(node.data);
        
        if(node.left==null && node.right == null){
            result.add(new ArrayList<>(sub));
        }
        
        pathToLeaf(node.left,result,sub);
        pathToLeaf(node.right,result,sub);
        sub.remove(sub.size()-1);
    }
    
}
        
var Products = new Product[]
{
    new Product { Product_ID = 1, Product_Name = "Gym T-Shirt", Product_Description = "Breathable cotton gym shirt", Product_Img = "gym_tshirt.jpg", Quantity = 50, Unit_Price = 19.99M, Size = "XS", Product_Category_ID = 1, Supplier_ID = 1 },
    new Product { Product_ID = 2, Product_Name = "Running Shorts", Product_Description = "Lightweight running shorts", Product_Img = "running_shorts.jpg", Quantity = 40, Unit_Price = 24.99M, Size = "M", Product_Category_ID = 2, Supplier_ID = 1 },
    new Product { Product_ID = 3, Product_Name = "Hoodie", Product_Description = "Fleece-lined gym hoodie", Product_Img = "hoodie.jpg", Quantity = 30, Unit_Price = 39.99M, Size = "L", Product_Category_ID = 2, Supplier_ID = 1 },
    new Product { Product_ID = 4, Product_Name = "Compression Tights", Product_Description = "High-performance compression tights", Product_Img = "compression_tights.jpg", Quantity = 60, Unit_Price = 29.99M, Size = "S", Product_Category_ID = 2, Supplier_ID = 1 },
    new Product { Product_ID = 5, Product_Name = "Gym Tank Top", Product_Description = "Sleeveless tank for workouts", Product_Img = "tank_top.jpg", Quantity = 70, Unit_Price = 15.99M, Size = "M", Product_Category_ID = 1, Supplier_ID = 1 },
    new Product { Product_ID = 6, Product_Name = "Sweatpants", Product_Description = "Comfortable gym sweatpants", Product_Img = "sweatpants.jpg", Quantity = 50, Unit_Price = 25.99M, Size = "L", Product_Category_ID = 2, Supplier_ID = 1 },
    new Product { Product_ID = 7, Product_Name = "Sports Bra", Product_Description = "Supportive sports bra", Product_Img = "sports_bra.jpg", Quantity = 40, Unit_Price = 19.99M, Size = "S", Product_Category_ID = 1, Supplier_ID = 1 },
    new Product { Product_ID = 8, Product_Name = "Gym Leggings", Product_Description = "High-waisted gym leggings", Product_Img = "gym_leggings.jpg", Quantity = 60, Unit_Price = 34.99M, Size = "M", Product_Category_ID = 2, Supplier_ID = 1 }
};

builder.Entity<Product>().HasData(Products);
if (condition)
  {
    return;
  }
else...
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":star: Introducing Xero Boost Days! :star:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Hey Perth! \n\nWe're excited to announce the launch of our Boost Day Program!\n\nStarting this week, as part of our <https://xpresso.xero.com/blog/featured/more-opportunities-to-come-together-with-xeros-connect/|*Xeros Connect Strategy*>, you'll experience supercharged days at the office every *Wednesday*. Get ready for a blend of delicious food, beverages and fun connections among each other!\n\nPlease see below for what's on this week! "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-31: Wednesday, 31st July",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Premium Coffee Experience*: Brew your own café-quality coffee and enjoy premium teas, syrups, and a variety of milk options.\n:breakfast: *Breakfast*: Provided by *Soul Origin* from *8:30AM - 10:30AM* in the office."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Stay tuned to this channel for more details, check out the <https://calendar.google.com/calendar/u/0?cid=Y180NzA5YTUyZjM5ZjBmMmU3MTBjZWQ3NGQ1Y2M5MzVlMjY3ZWFlMTI1NzMxYzAyODZkZWNhNjAyODU1OGM5M2U2QGdyb3VwLmNhbGVuZGFyLmdvb2dsZS5jb20|*Perth Social Calendar*>, and get ready to Boost your workdays!\n\nLove,\nWX Team :party-wx:"
			}
		}
	]
}
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      routerConfig: _router,
    );
  }
}
import 'package:go_router/go_router.dart';

// GoRouter configuration
final _router = GoRouter(
  initialLocation: '/',
  routes: [
    GoRoute(
      name: 'home', // Optional, add name to your routes. Allows you navigate by name instead of path
      path: '/',
      builder: (context, state) => HomeScreen(),
    ),
    GoRoute(
      name: 'page2',
      path: '/page2',
      builder: (context, state) => Page2Screen(),
    ),
  ],
);
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":star: Introducing Xero Boost Days! :star:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Hey Singapore! \n\nWe're excited to announce the launch of our Boost Day Program!\n\nStarting this week, as part of our <https://xpresso.xero.com/blog/featured/more-opportunities-to-come-together-with-xeros-connect/|*Xeros Connect Strategy*>, you'll experience supercharged days at the office every *Monday* and *Wednesday*. Get ready for a blend of delicious food, café beverages, promoted wellness activites, and just generally fun connections with each other!\n\nPlease see below for what's on this week! "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-29: Monday, 29th July",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Café Partnership*: Café-style beverages with Group Therapy Coffee\n:breakfast: *Breakfast*: Provided by *Group Therapy Café* from *8:30AM - 10:30AM* in the Kitchen."
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-31: Wednesday, 31st July",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Café Partnership*: Café-style beverages with Group Therapy Coffee\n:breakfast: *Lunch*: Provided by *Group Therapy Café* from *12PM - 2PM* in the Kitchen."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*LATER THIS MONTH:*"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*Wednesday, 28th August*\n :blob-party: *Social +*: Drinks, food, and engaging activities bringing everyone together."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Stay tuned to this channel for more details, check out the <https://calendar.google.com/calendar/u/0?cid=Y19lZTA1MmE0NWUxMzQ1OTQ0ZDRjOTk2M2IyNjA4M[…]MjRmZmJhODk0MGEwYjQ4ZDllQGdyb3VwLmNhbGVuZGFyLmdvb2dsZS5jb20|*Singapore Social Calendar*>, and get ready to Boost your workdays!\n\nLove,\nWX Team :party-wx:"
			}
		}
	]
}
sudo apt update        # Fetches the list of available updates
sudo apt upgrade       # Installs some updates; does not remove packages
sudo apt full-upgrade  # Installs updates; may also remove some packages, if needed
sudo apt autoremove    # Removes any old packages that are no longer needed
using av_motion_api.Data;
using av_motion_api.Interfaces;
using av_motion_api.Models;
using av_motion_api.ViewModels;
using Microsoft.AspNetCore.Mvc;

// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace av_motion_api.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class ProductController : ControllerBase
    {
        private readonly AppDbContext _appContext;
        public readonly IRepository _repository;
        public ProductController(AppDbContext _context, IRepository repository)
        {

            _appContext = _context;
            _repository = repository;
        }
        // GET: api/<ProductController>
        [HttpGet]
        public async Task<ActionResult<IEnumerable<ProductViewModel>>> GetProducts()
        {
            var products = await _repository.GetProducts();

            return Ok(products);
        }

        // GET api/<ProductController>/5
        [HttpGet("{id}")]
        public async Task<ActionResult<ProductViewModel>> GetProduct(int id)
        {
            if (_appContext.Products == null)
            {
                return NotFound();
            }
            var product = await _repository.GetProduct(id);
            if (product == null)
            {
                return NotFound();
            }

            return Ok(product);
        }
        //POST api/<ProductController>
        [HttpPost]
        public async Task<ActionResult<Product>> PostProduct([FromBody] ProductViewModel product)
        {
            var newProduct = new Product()
            {
                Product_Name = product.name,
                Product_Description = product.description,
                Create_Date = DateTime.Now,
                Last_Update_Date = DateTime.Now,
                IsActive = product.IsActive,
                Size = product.Size,
                Product_Category_ID = product.Product_Category_ID,
                Supplier_ID = product.Supplier_ID,

            };



            if (_appContext.Products == null)
            {
                return Problem("Entity set 'AppDbContext.Products'  is null.");
            }
            _appContext.Products.Add(newProduct);
            await _appContext.SaveChangesAsync();

            return Ok(newProduct);
        }


        // PUT api/<ProductController>/5
        [HttpPut("{id}")]
        public async Task<IActionResult> PutProduct(int id, [FromBody] ProductViewModel updatedProduct)
        {
            var existingproduct = await _appContext.Products.FindAsync(id);
            if (existingproduct == null)
            {
                return NotFound();
            }

            existingproduct.Product_Name = updatedProduct.name;
            existingproduct.Product_Description = updatedProduct.description;
            existingproduct.Last_Update_Date = DateTime.Now;
            existingproduct.Product_Category_ID = updatedProduct.Product_Category_ID;
            existingproduct.Size = updatedProduct.Size;
           
            return null;
        }

        // DELETE api/<ProductController>/5
        [HttpPut("hide-product/{id}")]
      
        public async Task<IActionResult> HideProduct(int id)
        {
            if (_appContext.Products == null)
            {
                return NotFound();
            }
            var product = await _appContext.Products.FindAsync(id);
            if (product == null)
            {
                return NotFound();
            }

            product.IsActive = false; 
            await _appContext.SaveChangesAsync();

            return NoContent();
        }

        [HttpPut("unhide-product/{id}")]

        public async Task<IActionResult> UnHideProduct(int id)
        {
            if (_appContext.Products == null)
            {
                return NotFound();
            }
            var product = await _appContext.Products.FindAsync(id);
            if (product == null)
            {
                return NotFound();
            }

            product.IsActive = true;
            await _appContext.SaveChangesAsync();

            return NoContent();
        }

        private bool ProductExists(int id)
        {
            return (_appContext.Products?.Any(e => e.Product_ID == id)).GetValueOrDefault();
        }

    }
}
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":star: Introducing Xero Boost Days! :star:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Sydney! \n\nWe're excited to announce the launch of our Boost Day Program!\n\nStarting this week, as part of our <https://xpresso.xero.com/blog/featured/more-opportunities-to-come-together-with-xeros-connect/|*Xeros Connect Strategy*>, you'll experience supercharged days at the office every *Wednesday* and *Thursday*. Get ready for a blend of delicious food, beverages, wellness activites, and fun connections!\n\nPlease see below for what's on this week! "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-31: Wednesday, 31th July",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Café Partnership*: Café Partnership: Enjoy free coffee and café-style beverages from our partner, *Elixir Sabour*, which used to be called Hungry Bean.\n:breakfast: *Morning Tea*: Provided by *Elixir Sabour* from *9AM - 10AM* in the All Hands.\n:massage:*Wellbeing*: Crossfit class at *Be Athletic* from 11am."
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-1: Thursday, 1st August",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":coffee: *Café Partnership*: Café Partnership: Enjoy coffee and café-style beverages from our partner, *Elixir Sabour*, which used to be called Hungry Bean.\n:late-cake: *Lunch*: Provided by *Elixir Sabour* from *12:30PM - 1:30PM* in the All Hands."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*LATER THIS MONTH:*"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*Thursday, 22nd August*\n :blob-party: *Social +*: Drinks, food, and engaging activities bringing everyone together."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Stay tuned to this channel for more details, check out the <https://calendar.google.com/calendar/u/0/r?cid=Y185aW90ZWV0cXBiMGZwMnJ0YmtrOXM2cGFiZ0Bncm91cC5jYWxlbmRhci5nb29nbGUuY29t|*Sydney Social Calendar*>, and get ready to Boost your workdays!\n\nLove,\nWX Team :party-wx:"
			}
		}
	]
}
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":star: Introducing Xero Boost Days! :star:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Hey Melbourne! \n\nWe're excited to announce the launch of our Boost Day Program!\n\nStarting this week, as part of our <https://xpresso.xero.com/blog/featured/more-opportunities-to-come-together-with-xeros-connect/|*Xeros Connect Strategy*>, you'll experience supercharged days at the office every *Wednesday* and *Thursday*. Get ready for a blend of delicious food, beverages, wellness activites, and fun connections!\n\nPlease see below for what's on this week! "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-30: Wednesday, 31st July",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Xero Café*: Café-style beverages and sweet treats.\n:clipboard: *Weekly Café Special*: _Biscoff Latte_.\n:late-cake: *Afternoon Tea*: Provided by *Your Private Chef* from *2pm - 3pm* in the Wominjeka Breakout Space.\n:massage:*Wellbeing - Massage*: Book a session <https://bookings.corporatebodies.com/|*here*> to relax and unwind. \n *Username:* xero \n *Password:* 1234"
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-1: Thursday, 1st August",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":coffee: *Xero Café*: Café-style beverages and sweet treats.\n:clipboard: *Weekly Café Special*: _Biscoff Latte_.\n:breakfast: *Breakfast*: Provided by *Kartel Catering* from *8:30am - 10:30am* in the Wominjeka Breakout Space.\n "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*LATER THIS MONTH:*"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*Thursday, 22nd August*\n :blob-party: *Social +*: Drinks, food, and engaging activities bringing everyone together."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Stay tuned to this channel for more details, check out the <https://calendar.google.com/calendar/u/0?cid=Y19xczkyMjk5ZGlsODJzMjA4aGt1b3RnM2t1MEBncm91cC5jYWxlbmRhci5nb29nbGUuY29t|*Melbourne Social Calendar*>, and get ready to Boost your workdays!\n\nLove,\nWX Team :party-wx:"
			}
		}
	]
}
function slick_cdn_enqueue_scripts(){
	wp_enqueue_style( 'slick-style', '//cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.css' );
	wp_enqueue_script( 'slick-script', '//cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.min.js', array(), null, true );
}
add_action( 'wp_enqueue_scripts', 'slick_cdn_enqueue_scripts' );
List<Account> accountList = new List<Account>();

Datetime startDttm = System.now();
for( Integer i = 0; i < 1000; i++ ) {
	update accountList;
}
system.debug( 'update no checks -> ' + ( System.now().getTime() - startDttm.getTime() ) );

startDttm = System.now();
for( Integer j = 0; j < 1000; j++ ) {
    if( ! accountList.isEmpty() ) {
        update accountList;
    }
}
system.debug( 'check before update -> ' + ( System.now().getTime() - startDttm.getTime() ) );
*DateTable = 
VAR MinDate = MIN(OE_INV_SNAPSHOTS[Actual_Snapshot_Date])
VAR MaxDate = MAX(OE_INV_SNAPSHOTS[Actual_Snapshot_Date])
RETURN
ADDCOLUMNS (
    CALENDAR ( MinDate, MaxDate ),
    "Year", YEAR([Date]),
    "Month", MONTH([Date]),
    "Day", DAY([Date]),
    "Quarter", QUARTER([Date]),
    "MonthName", FORMAT([Date], "MMMM"),
    "Weekday", WEEKDAY([Date], 2),
    "WeekdayName", FORMAT([Date], "dddd"),
    "YearMonth", FORMAT([Date], "YYYY-MM")
)
@ECHO OFF

@REM WARNING: This file is created by the Configuration Wizard.
@REM Any changes to this script may be lost when adding extensions to this configuration.

SETLOCAL

@REM --- Start Functions ---

GOTO :ENDFUNCTIONS

:stopAll
    @REM We separate the stop commands into a function so we are able to use the trap command in Unix (calling a function) to stop these services
    if NOT "X%ALREADY_STOPPED%"=="X" (
        exit /b
    )
    @REM STOP DERBY (only if we started it)
    if "%DERBY_FLAG%"=="true" (
        echo Stopping Derby server...
        call "%WL_HOME%\common\derby\bin\stopNetworkServer.cmd"  >"%DOMAIN_HOME%\derbyShutdown.log" 2>&1 

        echo Derby server stopped.
    )

    set ALREADY_STOPPED=true
GOTO :EOF

:generateClassList
    set JAVA_OPTIONS=%JAVA_OPTIONS% -Xshare:off -XX:+UnlockCommercialFeatures -XX:+IgnoreEmptyClassPaths -XX:DumpLoadedClassList=%APPCDS_CLASS_LIST% -XX:+UseAppCDS
GOTO :EOF

:useArchive
    set JAVA_OPTIONS=%JAVA_OPTIONS% -XX:+UnlockCommercialFeatures -Xshare:auto -XX:+UseAppCDS -XX:+IgnoreEmptyClassPaths -XX:SharedArchiveFile=%APPCDS_ARCHIVE% -showversion
    set USING_SHOWVERSION=true
GOTO :EOF


:ENDFUNCTIONS
ECHO HOLA.........................................................................
@REM --- End Functions ---

@REM *************************************************************************
@REM This script is used to start WebLogic Server for this domain.
@REM 
@REM To create your own start script for your domain, you can initialize the
@REM environment by calling @USERDOMAINHOME\setDomainEnv.
@REM 
@REM setDomainEnv initializes or calls commEnv to initialize the following variables:
@REM 
@REM BEA_HOME       - The BEA home directory of your WebLogic installation.
@REM JAVA_HOME      - Location of the version of Java used to start WebLogic
@REM                  Server.
@REM JAVA_VENDOR    - Vendor of the JVM (i.e. BEA, HP, IBM, Sun, etc.)
@REM PATH           - JDK and WebLogic directories are added to system path.
@REM WEBLOGIC_CLASSPATH
@REM                - Classpath needed to start WebLogic Server.
@REM PATCH_CLASSPATH - Classpath used for patches
@REM PATCH_LIBPATH  - Library path used for patches
@REM PATCH_PATH     - Path used for patches
@REM WEBLOGIC_EXTENSION_DIRS - Extension dirs for WebLogic classpath patch
@REM JAVA_VM        - The java arg specifying the VM to run.  (i.e.
@REM                - server, -hotspot, etc.)
@REM USER_MEM_ARGS  - The variable to override the standard memory arguments
@REM                  passed to java.
@REM PRODUCTION_MODE - The variable that determines whether Weblogic Server is started in production mode.
@REM DERBY_HOME - Derby home directory.
@REM DERBY_CLASSPATH
@REM                - Classpath needed to start Derby.
@REM 
@REM Other variables used in this script include:
@REM SERVER_NAME    - Name of the weblogic server.
set "JAVA_OPTIONS=%JAVA_OPTIONS% -DUPLOAD_HOME=C:\files"
@REM JAVA_OPTIONS   - Java command-line options for running the server. (These
@REM                  will be tagged on to the end of the JAVA_VM and
@REM                  MEM_ARGS)
@REM PROXY_SETTINGS - These are tagged on to the end of the JAVA_OPTIONS. This variable is deprecated and should not
@REM                  be used. Instead use JAVA_OPTIONS
@REM 
@REM For additional information, refer to "Administering Server Startup and Shutdown for Oracle WebLogic Server"
@REM *************************************************************************

set SCRIPTPATH=%~dp0
set SCRIPTPATH=%SCRIPTPATH%
for %%i in ("%SCRIPTPATH%") do set SCRIPTPATH=%%~fsi


@REM Call setDomainEnv here.

set DOMAIN_HOME=C:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain
for %%i in ("%DOMAIN_HOME%") do set DOMAIN_HOME=%%~fsi

call "%DOMAIN_HOME%\bin\setDomainEnv.cmd" %*

set SAVE_JAVA_OPTIONS=%JAVA_OPTIONS%

set SAVE_CLASSPATH=%CLASSPATH%

set TMP_UPDATE_SCRIPT=%TMP%\update.cmd


@REM Start Derby

set DERBY_DEBUG_LEVEL=0

if "%DERBY_FLAG%"=="true" (
    call "%WL_HOME%\common\derby\bin\startNetworkServer.cmd"  >"%DOMAIN_HOME%\derby.log" 2>&1 

)

set JAVA_OPTIONS=%SAVE_JAVA_OPTIONS%

@REM In order to use resource consumption management policies or to get partition's resource consumption metrics, uncomment the following JAVA_OPTIONS

set #JAVA_OPTIONS=-XX:+UnlockCommercialFeatures -XX:+ResourceManagement -XX:+UseG1GC %SAVE_JAVA_OPTIONS%

set SAVE_JAVA_OPTIONS=

set CLASSPATH=%SAVE_CLASSPATH%

set SAVE_CLASSPATH=

if "%PRODUCTION_MODE%"=="true" (
    set WLS_DISPLAY_MODE=Production
) else (
    set WLS_DISPLAY_MODE=Development
)

if NOT "%WLS_USER%"=="" (
    set JAVA_OPTIONS=%JAVA_OPTIONS% -Dweblogic.management.username=%WLS_USER%
)

if NOT "%WLS_PW%"=="" (
    set JAVA_OPTIONS=%JAVA_OPTIONS% -Dweblogic.management.password=%WLS_PW%
)

if NOT "%MEDREC_WEBLOGIC_CLASSPATH%"=="" (
    if NOT "%CLASSPATH%"=="" (
        set CLASSPATH=%CLASSPATH%;%MEDREC_WEBLOGIC_CLASSPATH%
    ) else (
        set CLASSPATH=%MEDREC_WEBLOGIC_CLASSPATH%
    )
)

if "%GENERATE_CLASS_LIST%"=="true" (
    CALL :generateClassList
)

if "%USE_ARCHIVE%"=="true" (
    CALL :useArchive
)

echo .

echo .

echo JAVA Memory arguments: %MEM_ARGS%

echo .

echo CLASSPATH=%CLASSPATH%

echo .

echo PATH=%PATH%

echo .

echo ***************************************************

echo *  To start WebLogic Server, use a username and   *

echo *  password assigned to an admin-level user.  For *

echo *  server administration, use the WebLogic Server *

echo *  console at http:\\hostname:port\console        *

echo ***************************************************

@REM START WEBLOGIC

if NOT "%USE_JVM_SYSTEM_LOADER%"=="true" (
    set LAUNCH_ARGS=-cp %WL_HOME%\server\lib\weblogic-launcher.jar -Dlaunch.use.env.classpath=true
)

if "%USING_SHOWVERSION%"=="true" (
    echo starting weblogic with Java version:
    %JAVA_HOME%\bin\java %JAVA_VM% -version
)

if "%WLS_REDIRECT_LOG%"=="" (
    echo Starting WLS with line:
    echo %JAVA_HOME%\bin\java %JAVA_VM% %MEM_ARGS% %LAUNCH_ARGS% -Dweblogic.Name=%SERVER_NAME% -Djava.security.policy=%WLS_POLICY_FILE% %JAVA_OPTIONS% %PROXY_SETTINGS% %SERVER_CLASS%
    %JAVA_HOME%\bin\java %JAVA_VM% %MEM_ARGS% %LAUNCH_ARGS% -Dweblogic.Name=%SERVER_NAME% -Djava.security.policy=%WLS_POLICY_FILE% %JAVA_OPTIONS% %PROXY_SETTINGS% %SERVER_CLASS%
) else (
    echo Redirecting output from WLS window to %WLS_REDIRECT_LOG%
    %JAVA_HOME%\bin\java %JAVA_VM% %MEM_ARGS% %LAUNCH_ARGS% -Dweblogic.Name=%SERVER_NAME% -Djava.security.policy=%WLS_POLICY_FILE% %JAVA_OPTIONS% %PROXY_SETTINGS% %SERVER_CLASS%  >"%WLS_REDIRECT_LOG%" 2>&1 
)

IF ERRORLEVEL 86 IF NOT ERRORLEVEL 87 (set shutDownStatus=86) ELSE (IF ERRORLEVEL 88 IF NOT ERRORLEVEL 89 ( set shutDownStatus=88 ) )


CALL :stopAll

popd

IF EXIST %TMP_UPDATE_SCRIPT% (set fileExists=true) ELSE (set fileExists=false)


if "%shutDownStatus%"=="86" (
    if "%fileExists%"=="true" (
        echo Calling %TMP_UPDATE_SCRIPT%

        cd %TMP:~0,2%
        cd %TMP%
        call %TMP_UPDATE_SCRIPT%
        IF ERRORLEVEL 42 IF NOT ERRORLEVEL 43 (set ustatus=42 )

        @REM restoring the original env before unsetting JAVA_HOME
        @REM in order to unset any JAVA_HOME that was passed in from domainEnv
        if "%ustatus%"=="42" (
            set JAVA_HOME=
        )
    ) else (
        echo ERROR! %TMP_UPDATE_SCRIPT% did not exist
    )
    @REM Call the same script path that was supplied in order to restart ourselves
    @REM restoreOrigEnv will go here

    call "%SCRIPTPATH%\startWebLogic.cmd"

) else (
    if "%shutDownStatus%"=="88" (
        @REM restoreOrigEnv will go here

        call "%SCRIPTPATH%\startWebLogic.cmd"

    )
)

@REM Exit this script only if we have been told to exit.

if "%doExitFlag%"=="true" (
    exit
)



ENDLOCAL

// } Driver Code Ends


//User function Template for Java


class Solution
{
    //Function to return a list containing the bottom view of the given tree.
    public ArrayList <Integer> bottomView(Node root)
    {
        // Code here
        
        Queue<Pair> q = new ArrayDeque<>();
        
        TreeMap<Integer,Integer> mpp=new TreeMap<>();
        
        q.add(new Pair(0,root));
        
        while(!q.isEmpty()){
            Pair curr = q.poll();
            mpp.put(curr.hd,curr.node.data);
            
            if(curr.node.left!=null){
                q.add(new Pair(curr.hd-1,curr.node.left));
            }
            if(curr.node.right!=null){
                q.add(new Pair(curr.hd+1,curr.node.right));
            }
        }
        
        
        ArrayList<Integer> res = new ArrayList<>();
        
        for(Map.Entry<Integer,Integer> entry: mpp.entrySet()){
            res.add(entry.getValue());
        }
        
        
        return res;
        
        
        
    }
    
    
    static class Pair{
        int hd;
        Node node;
        
        public Pair(int hd,Node node){
            this.hd=hd;
            this.node = node;
        }
    }
    
    
}
 class Solution{
    //Function to return a list containing the bottom view of the given tree.
    public ArrayList <Integer> bottomView(Node root){
        // Code here
        
         
    
        // Code here
        
        Queue<Pair> q = new ArrayDeque<>();
        
        TreeMap<Integer,Integer> mpp=new TreeMap<>();
        
        q.add(new Pair(0,root));
        
        while(!q.isEmpty()){
            Pair curr = q.poll();
            mpp.put(curr.hd,curr.node.data);
            
            if(curr.node.left!=null){
                q.add(new Pair(curr.hd-1,curr.node.left));
            }
            if(curr.node.right!=null){
                q.add(new Pair(curr.hd+1,curr.node.right));
            }
        }
        
        
        ArrayList<Integer> res = new ArrayList<>();
        
        for(Map.Entry<Integer,Integer> entry: mpp.entrySet()){
            res.add(entry.getValue());
        }
        
        
        return res;
        
        
        
    }
    
    static class Pair{
        int hd;
        Node node;
        
        public Pair(int hd,Node node){
            this.hd=hd;
            this.node = node;
        }
    }
    
    
    
    
    
    
}           
                        
import datetime
import json

from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange, Range

from django.contrib.postgres import forms, lookups
from django.db import models
from django.db.models.lookups import PostgresOperatorLookup

from .utils import AttributeSetter

__all__ = [
    'RangeField', 'IntegerRangeField', 'BigIntegerRangeField',
    'DecimalRangeField', 'DateTimeRangeField', 'DateRangeField',
    'RangeBoundary', 'RangeOperators',
]



[docs]class RangeBoundary(models.Expression):
    """A class that represents range boundaries."""
    def __init__(self, inclusive_lower=True, inclusive_upper=False):
        self.lower = '[' if inclusive_lower else '('
        self.upper = ']' if inclusive_upper else ')'

    def as_sql(self, compiler, connection):
        return "'%s%s'" % (self.lower, self.upper), []




[docs]class RangeOperators:
    # https://www.postgresql.org/docs/current/functions-range.html#RANGE-OPERATORS-TABLE
    EQUAL = '='
    NOT_EQUAL = '<>'
    CONTAINS = '@>'
    CONTAINED_BY = '<@'
    OVERLAPS = '&&'
    FULLY_LT = '<<'
    FULLY_GT = '>>'
    NOT_LT = '&>'
    NOT_GT = '&<'
    ADJACENT_TO = '-|-'




[docs]class RangeField(models.Field):
    empty_strings_allowed = False

    def __init__(self, *args, **kwargs):
        # Initializing base_field here ensures that its model matches the model for self.
        if hasattr(self, 'base_field'):
            self.base_field = self.base_field()
        super().__init__(*args, **kwargs)

    @property
    def model(self):
        try:
            return self.__dict__['model']
        except KeyError:
            raise AttributeError("'%s' object has no attribute 'model'" % self.__class__.__name__)

    @model.setter
    def model(self, model):
        self.__dict__['model'] = model
        self.base_field.model = model

    @classmethod
    def _choices_is_value(cls, value):
        return isinstance(value, (list, tuple)) or super()._choices_is_value(value)

    def get_prep_value(self, value):
        if value is None:
            return None
        elif isinstance(value, Range):
            return value
        elif isinstance(value, (list, tuple)):
            return self.range_type(value[0], value[1])
        return value

    def to_python(self, value):
        if isinstance(value, str):
            # Assume we're deserializing
            vals = json.loads(value)
            for end in ('lower', 'upper'):
                if end in vals:
                    vals[end] = self.base_field.to_python(vals[end])
            value = self.range_type(**vals)
        elif isinstance(value, (list, tuple)):
            value = self.range_type(value[0], value[1])
        return value

    def set_attributes_from_name(self, name):
        super().set_attributes_from_name(name)
        self.base_field.set_attributes_from_name(name)

    def value_to_string(self, obj):
        value = self.value_from_object(obj)
        if value is None:
            return None
        if value.isempty:
            return json.dumps({"empty": True})
        base_field = self.base_field
        result = {"bounds": value._bounds}
        for end in ('lower', 'upper'):
            val = getattr(value, end)
            if val is None:
                result[end] = None
            else:
                obj = AttributeSetter(base_field.attname, val)
                result[end] = base_field.value_to_string(obj)
        return json.dumps(result)

    def formfield(self, **kwargs):
        kwargs.setdefault('form_class', self.form_field)
        return super().formfield(**kwargs)




[docs]class IntegerRangeField(RangeField):
    base_field = models.IntegerField
    range_type = NumericRange
    form_field = forms.IntegerRangeField

    def db_type(self, connection):
        return 'int4range'




[docs]class BigIntegerRangeField(RangeField):
    base_field = models.BigIntegerField
    range_type = NumericRange
    form_field = forms.IntegerRangeField

    def db_type(self, connection):
        return 'int8range'




[docs]class DecimalRangeField(RangeField):
    base_field = models.DecimalField
    range_type = NumericRange
    form_field = forms.DecimalRangeField

    def db_type(self, connection):
        return 'numrange'




[docs]class DateTimeRangeField(RangeField):
    base_field = models.DateTimeField
    range_type = DateTimeTZRange
    form_field = forms.DateTimeRangeField

    def db_type(self, connection):
        return 'tstzrange'




[docs]class DateRangeField(RangeField):
    base_field = models.DateField
    range_type = DateRange
    form_field = forms.DateRangeField

    def db_type(self, connection):
        return 'daterange'



RangeField.register_lookup(lookups.DataContains)
RangeField.register_lookup(lookups.ContainedBy)
RangeField.register_lookup(lookups.Overlap)


class DateTimeRangeContains(PostgresOperatorLookup):
    """
    Lookup for Date/DateTimeRange containment to cast the rhs to the correct
    type.
    """
    lookup_name = 'contains'
    postgres_operator = RangeOperators.CONTAINS

    def process_rhs(self, compiler, connection):
        # Transform rhs value for db lookup.
        if isinstance(self.rhs, datetime.date):
            value = models.Value(self.rhs)
            self.rhs = value.resolve_expression(compiler.query)
        return super().process_rhs(compiler, connection)

    def as_postgresql(self, compiler, connection):
        sql, params = super().as_postgresql(compiler, connection)
        # Cast the rhs if needed.
        cast_sql = ''
        if (
            isinstance(self.rhs, models.Expression) and
            self.rhs._output_field_or_none and
            # Skip cast if rhs has a matching range type.
            not isinstance(self.rhs._output_field_or_none, self.lhs.output_field.__class__)
        ):
            cast_internal_type = self.lhs.output_field.base_field.get_internal_type()
            cast_sql = '::{}'.format(connection.data_types.get(cast_internal_type))
        return '%s%s' % (sql, cast_sql), params


DateRangeField.register_lookup(DateTimeRangeContains)
DateTimeRangeField.register_lookup(DateTimeRangeContains)


class RangeContainedBy(PostgresOperatorLookup):
    lookup_name = 'contained_by'
    type_mapping = {
        'smallint': 'int4range',
        'integer': 'int4range',
        'bigint': 'int8range',
        'double precision': 'numrange',
        'numeric': 'numrange',
        'date': 'daterange',
        'timestamp with time zone': 'tstzrange',
    }
    postgres_operator = RangeOperators.CONTAINED_BY

    def process_rhs(self, compiler, connection):
        rhs, rhs_params = super().process_rhs(compiler, connection)
        # Ignore precision for DecimalFields.
        db_type = self.lhs.output_field.cast_db_type(connection).split('(')[0]
        cast_type = self.type_mapping[db_type]
        return '%s::%s' % (rhs, cast_type), rhs_params

    def process_lhs(self, compiler, connection):
        lhs, lhs_params = super().process_lhs(compiler, connection)
        if isinstance(self.lhs.output_field, models.FloatField):
            lhs = '%s::numeric' % lhs
        elif isinstance(self.lhs.output_field, models.SmallIntegerField):
            lhs = '%s::integer' % lhs
        return lhs, lhs_params

    def get_prep_lookup(self):
        return RangeField().get_prep_value(self.rhs)


models.DateField.register_lookup(RangeContainedBy)
models.DateTimeField.register_lookup(RangeContainedBy)
models.IntegerField.register_lookup(RangeContainedBy)
models.FloatField.register_lookup(RangeContainedBy)
models.DecimalField.register_lookup(RangeContainedBy)


@RangeField.register_lookup
class FullyLessThan(PostgresOperatorLookup):
    lookup_name = 'fully_lt'
    postgres_operator = RangeOperators.FULLY_LT


@RangeField.register_lookup
class FullGreaterThan(PostgresOperatorLookup):
    lookup_name = 'fully_gt'
    postgres_operator = RangeOperators.FULLY_GT


@RangeField.register_lookup
class NotLessThan(PostgresOperatorLookup):
    lookup_name = 'not_lt'
    postgres_operator = RangeOperators.NOT_LT


@RangeField.register_lookup
class NotGreaterThan(PostgresOperatorLookup):
    lookup_name = 'not_gt'
    postgres_operator = RangeOperators.NOT_GT


@RangeField.register_lookup
class AdjacentToLookup(PostgresOperatorLookup):
    lookup_name = 'adjacent_to'
    postgres_operator = RangeOperators.ADJACENT_TO


@RangeField.register_lookup
class RangeStartsWith(models.Transform):
    lookup_name = 'startswith'
    function = 'lower'

    @property
    def output_field(self):
        return self.lhs.output_field.base_field


@RangeField.register_lookup
class RangeEndsWith(models.Transform):
    lookup_name = 'endswith'
    function = 'upper'

    @property
    def output_field(self):
        return self.lhs.output_field.base_field


@RangeField.register_lookup
class IsEmpty(models.Transform):
    lookup_name = 'isempty'
    function = 'isempty'
    output_field = models.BooleanField()


@RangeField.register_lookup
class LowerInclusive(models.Transform):
    lookup_name = 'lower_inc'
    function = 'LOWER_INC'
    output_field = models.BooleanField()


@RangeField.register_lookup
class LowerInfinite(models.Transform):
    lookup_name = 'lower_inf'
    function = 'LOWER_INF'
    output_field = models.BooleanField()


@RangeField.register_lookup
class UpperInclusive(models.Transform):
    lookup_name = 'upper_inc'
    function = 'UPPER_INC'
    output_field = models.BooleanField()


@RangeField.register_lookup
class UpperInfinite(models.Transform):
    lookup_name = 'upper_inf'
    function = 'UPPER_INF'
    output_field = models.BooleanField()
function add_custom_body_class($classes) {
if (has_blocks()) {
$classes[] = 'gutenberg-page';
}
if (is_woocommerce() || is_shop() || is_product_category() || is_product_tag()) {
$classes[] = 'woocommerce-page';
}
return $classes;
}
add_filter('body_class', 'add_custom_body_class');
//User function Template for Java

/* A Binary Tree node
class Node
{
    int data;
    Node left, right;

    Node(int item)
    {
        data = item;
        left = right = null;
    }
}*/
class Tree
{
    //Function to return list containing elements of left view of binary tree.
    ArrayList<Integer> leftView(Node root)
    {
      // Your code here
      
      ArrayList<Integer> res = new ArrayList<>();
      int level =0;
      
      leftView(root,res,level);
      
      return res;
    }
    
    
    private void leftView(Node node , List<Integer> res,int level){
        if(node == null){
            return;
        }
        
        if(level ==res.size()){
            res.add(node.data);
        }
        
        leftView(node.left,res,level+1);
        leftView(node.right,res,level+1);
    }
    
    
    
}
/**
 * Definition for a binary tree node.
 * public class TreeNode {
 *     int val;
 *     TreeNode left;
 *     TreeNode right;
 *     TreeNode() {}
 *     TreeNode(int val) { this.val = val; }
 *     TreeNode(int val, TreeNode left, TreeNode right) {
 *         this.val = val;
 *         this.left = left;
 *         this.right = right;
 *     }
 * }
 */
class Solution {
    ArrayList<Integer> res = new ArrayList<>();
    public List<Integer> postorderTraversal(TreeNode root) {
        postOrder(root);
        return res;
    }

    private void postOrder(TreeNode root){
        if(root == null){
            return;
        }
        postOrder(root.left);
        postOrder(root.right);
        res.add(root.val);
    }
}
/**
 * Definition for a binary tree node.
 * public class TreeNode {
 *     int val;
 *     TreeNode left;
 *     TreeNode right;
 *     TreeNode() {}
 *     TreeNode(int val) { this.val = val; }
 *     TreeNode(int val, TreeNode left, TreeNode right) {
 *         this.val = val;
 *         this.left = left;
 *         this.right = right;
 *     }
 * }
 */
class Solution {
    public List<Integer> preorderTraversal(TreeNode root) {

        List<Integer> res = new ArrayList<>();

        preOrder(root,res);

        return res;
        
    }


    private void preOrder(TreeNode node,List<Integer> res){
        if(node == null){
            return;
        }

        res.add(node.val);
        preOrder(node.left,res);
        preOrder(node.right,res);



    }
}
/**
 * Definition for a binary tree node.
 * public class TreeNode {
 * int val;
 * TreeNode left;
 * TreeNode right;
 * TreeNode() {}
 * TreeNode(int val) { this.val = val; }
 * TreeNode(int val, TreeNode left, TreeNode right) {
 * this.val = val;
 * this.left = left;
 * this.right = right;
 * }
 * }
 */
class Solution {
    public List<Integer> inorderTraversal(TreeNode root) {

        ArrayList<Integer> res = new ArrayList<>();
        inOrder(root, res);
        return res;

    }

    private void inOrder(TreeNode node, List<Integer> res) {
        if (node == null) {
            return;
        }

        inOrder(node.left, res);
        res.add(node.val);
        inOrder(node.right, res);
    }
}
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        
        int n = 4;
        int m =5;
        
        // outer loop
        for (int i = 1; i <=n ; i++) {
            // inner loop
            for (int j = 1; j <= m; j++) {
                if (i==1 || i==n || j==1 || j==m) {
                    System.out.print("*");
                }
                else {
                    System.out.print(" ");
                }

            }
            System.out.println();
           
        }
        
    }
}
 {
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":star: Introducing Xero Boost Days! :star:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Hey Wellington! \n\nWe're excited to announce the launch of our Boost Day Program!\n\nStarting this week, as part of our <https://xpresso.xero.com/blog/featured/more-opportunities-to-come-together-with-xeros-connect/|*Xeros Connect Strategy*>, you'll experience supercharged days at the office every *Tuesday* and *Thursday*. Get ready for a blend of delicious food, beverages, wellness activites, and fun connections!\n\nPlease see below for what's on this week! "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-30: Tuesday, 30th July",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Xero Café*: Café-style beverages and sweet treats.\n:clipboard: *Weekly Café Special*: _Caramel Mocha Latte_.\n:breakfast: *Breakfast*: Provided by *Simply Food* from *8AM - 10AM* in the All Hands.\n:massage:*Wellbeing - Massage*: Book a session <https://www.google.com/|*here*> to relax and unwind."
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-1: Thursday, 1st August",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":coffee: *Xero Café*: Café-style beverages and sweet treats.\n:clipboard: *Weekly Café Special*: _Caramel Mocha Latte_.\n:late-cake: *Afternoon Tea*: Provided by *Little Bread Loaf* from *2:30PM - 3:30PM* in the All Hands.\n:yoga:*Fitness - Yoga Class*: Instructor-led session at *10:30AM* in the Gym. Sign up <google.com|*here*>!"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*LATER THIS MONTH:*"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*Thursday, 22nd August*\n :blob-party: *Social +*: Drinks, food, and engaging activities bringing everyone together."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Stay tuned to this channel for more details, check out the <https://calendar.google.com/calendar/u/0?cid=Y180Y2UwNGEwNjY2YjI5NDNlZmEwZGM4YWI5MTdjMTcyNDE2NzVhZmQ5MTllN2EwZjg5NTg5OTVkMTA2MDAzZmEwQGdyb3VwLmNhbGVuZGFyLmdvb2dsZS5jb20|*Wellington Social Calendar*>, and get ready to Boost your workdays!\n\nLove,\nWX Team :party-wx:"
			}
		}
	]
}
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
@ECHO OFF
set list=Desktop Documents Downloads Favorites Music Pictures Videos
set baseLocation="%USERPROFILE%\OneDrive - Olivet Nazarene University\LocalPC\"
set "Key=HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders"
set "Typ=REG_EXPAND_SZ"
set RegList="Desktop" "Personal" "{374DE290-123F-4565-9164-39C4925E467B}" "Favorites" "My Music" "My Pictures" "My Video"
set /a c=0
setLocal enableDelayedExpansion
for %%j in (%RegList%) do (
    set RegList[!c!]=%%j & set /a c=c+1
)
for %%i in (%list%) do (
    if not exist %baseLocation%%%i (
        mkdir %baseLocation%%%i
    ) else (
        echo %%i already exsists
    )
)
set baseLocation=%baseLocation:"=%
for %%i in (%list%) do (
    RoboCopy.exe "%USERPROFILE%\%%~i\." "%baseLocation%\%%~i\." *.* /MOV /FP /NP /IS /Z /E /NFL /NDL /NJH
)
set /a d=0
for %%k in (%list%) do (
    call set val=%%RegList[!d!]%% & Reg Add "%Key%" /f /V !val! /T %Typ% /D "%baseLocation%%%k" & set /a d=d+1
)  
echo DONE!
pause
@ECHO OFF
set list=Desktop Documents Downloads Favorites Music Pictures Videos
set baseLocation="%USERPROFILE%\OneDrive - Olivet Nazarene University\LocalPC\"
set "Key=HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders"
set "Typ=REG_EXPAND_SZ"
set RegList="Desktop" "Personal" "{374DE290-123F-4565-9164-39C4925E467B}" "Favorites" "My Music" "My Pictures" "My Video"
set /a c=0
setLocal enableDelayedExpansion
for %%j in (%RegList%) do (
    set RegList[!c!]=%%j & set /a c=c+1
)
for %%i in (%list%) do (
    if not exist %baseLocation%%%i (
        mkdir %baseLocation%%%i
    ) else (
        echo %%i already exsists
    )
)
set baseLocation=%baseLocation:"=%
for %%i in (%list%) do (
    RoboCopy.exe "%USERPROFILE%\%%~i\." "%baseLocation%\%%~i\." *.* /MOV /FP /NP /IS /Z /E /NFL /NDL /NJH
)
set /a d=0
for %%k in (%list%) do (
    call set val=%%RegList[!d!]%% & Reg Add "%Key%" /f /V !val! /T %Typ% /D "%baseLocation%%%k" & set /a d=d+1
)  
echo DONE!
pause
[HttpPost]
[Route("ForgotPassword")]
public async Task<IActionResult> ForgotPassword(ForgotPasswordViewModel model)
{
    if (!ModelState.IsValid)
    {
        return BadRequest("Invalid data.");
    }

    var user = await _userManager.FindByEmailAsync(model.Email);
    if (user == null)
    {
        return NotFound("User not found.");
    }

    var token = await _userManager.GeneratePasswordResetTokenAsync(user);
    var encodedToken = HttpUtility.UrlEncode(token);

    // Send the token to the user's email
    var resetLink = Url.Action("ResetPassword", "Account", new { token = encodedToken, email = model.Email }, Request.Scheme);
    // Add email sending logic here

    return Ok(encodedToken);
}



[HttpPost]
[Route("ResetPassword")]
public async Task<IActionResult> ResetPassword([FromBody] ResetPasswordViewModel model)
{
    if (!ModelState.IsValid)
    {
        return BadRequest("Invalid data.");
    }

    var user = await _userManager.FindByEmailAsync(model.Email);
    if (user == null)
    {
        return NotFound("User not found.");
    }

    var decodedToken = HttpUtility.UrlDecode(model.Token);
    var result = await _userManager.ResetPasswordAsync(user, decodedToken, model.Password);
    if (result.Succeeded)
    {
        return Ok("Password has been reset successfully.");
    }

    // Log errors for debugging
    var errors = string.Join(", ", result.Errors.Select(e => e.Description));
    return BadRequest($"Error while resetting the password: {errors}");
}
/// Usage


 CustomPaint(
                        painter: SegmentBorderPainter(
                          divisions: 3, // Number of divisions
                          gradient: const LinearGradient(
                            colors: [
                              Colors.orange,
                              Colors.orange,
                              Colors.red,
                              Colors.red,
                            ],
                          ),
                        ), 
                        child: Container(
                          height: 58.r,
                          width: 58.r,
                          child: SizedBox.shrink(),
                          ),
                        ),
                      ),


/// CODE

class SegmentBorderPainter extends CustomPainter {
  final int divisions;
  final double strokeWidth;
  final Gradient gradient;

  SegmentBorderPainter({
    required this.divisions,
    this.strokeWidth = 3.0,
    required this.gradient,
  });

  @override
  void paint(Canvas canvas, Size size) {
    final Paint paint = Paint()
      ..strokeWidth = strokeWidth
      ..style = PaintingStyle.stroke;

    final double radius = size.width / 2;
    final double angle = (2 * 3.141592653589793) / divisions;
    const double startAngle = -3.141592653589793 / 2;

    paint.shader = gradient.createShader(
      Rect.fromCircle(center: Offset(radius, radius), radius: radius),
    );

    if (divisions == 1) {
      canvas.drawCircle(Offset(radius, radius), radius, paint);
    } else if (divisions == 2) {
      for (int i = 0; i < divisions; i++) {
        canvas.drawArc(
          Rect.fromCircle(center: Offset(radius, radius), radius: radius),
          startAngle + i * angle + 0.08,
          angle * 0.95,
          false,
          paint,
        );
      }
    } else {
      for (int i = 0; i < divisions; i++) {
        canvas.drawArc(
          Rect.fromCircle(center: Offset(radius, radius), radius: radius),
          startAngle + i * angle + 0.05,
          angle * 0.95,
          false,
          paint,
        );
      }
    }
  }

  @override
  bool shouldRepaint(covariant CustomPainter oldDelegate) {
    return false;
  }
}
<#
Run Get-ExecutionPolicy. If it returns Restricted, then run Set-ExecutionPolicy AllSigned or Set-ExecutionPolicy Bypass -Scope Process.
Now run the following command:
#>

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
using av_motion_api.Data;
using av_motion_api.Factory;
using av_motion_api.Models;
using av_motion_api.Interfaces;
using av_motion_api.Services;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
using Microsoft.IdentityModel.Tokens;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.Extensions.Logging;
using System.Text;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using System.Text.Json.Serialization;

var builder = WebApplication.CreateBuilder(args);

// Configure the app environment
ConfigurationManager configuration = builder.Configuration;

builder.Configuration.SetBasePath(Directory.GetCurrentDirectory())
    .AddJsonFile($"appsettings.{builder.Environment.EnvironmentName}.json", optional: false);

builder.Host.ConfigureAppConfiguration((hostingContext, config) =>
{
    config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
    config.AddJsonFile($"appsettings.{builder.Environment.EnvironmentName}.json", optional: true);
});

// Configure logging
builder.Logging.ClearProviders();
builder.Logging.AddConsole();
builder.Logging.AddDebug();

// CORS
if (builder.Environment.IsDevelopment())
{
    builder.Services.AddCors(options =>
    {
        options.AddPolicy("AllowAll", policy =>
        {
            policy.AllowAnyOrigin()
                  .AllowAnyHeader()
                  .AllowAnyMethod();
        });
    });
}

// Add services to the container
builder.Services.AddControllers()
                .AddJsonOptions(options =>
                {
                    options.JsonSerializerOptions.ReferenceHandler = ReferenceHandler.IgnoreCycles;
                    options.JsonSerializerOptions.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull;
                });

// SQL
builder.Services.AddDbContext<AppDbContext>(options =>
    options.UseSqlServer(configuration.GetConnectionString("DefaultConnection")));
builder.Services.AddScoped<IRepository, Repository>();

builder.Services.AddIdentity<User, Role>(options =>
                {
                    options.Password.RequireUppercase = false;
                    options.Password.RequireLowercase = false;
                    options.Password.RequireNonAlphanumeric = false;
                    options.Password.RequireDigit = true;
                    options.User.RequireUniqueEmail = true;
                })
                .AddRoles<Role>()
                .AddEntityFrameworkStores<AppDbContext>()
                .AddDefaultTokenProviders();

builder.Services.AddAuthentication(options =>
                {
                    options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
                    options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
                    options.DefaultScheme = JwtBearerDefaults.AuthenticationScheme;
                })
                .AddCookie()
                .AddJwtBearer(options =>
                {
                    options.TokenValidationParameters = new TokenValidationParameters()
                    {
                        ValidateIssuer = true,
                        ValidateAudience = true,
                        ValidateLifetime = true,
                        ValidateIssuerSigningKey = true,
                        ValidIssuer = builder.Configuration["Tokens:Issuer"],
                        ValidAudience = builder.Configuration["Tokens:Audience"],
                        IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(builder.Configuration["Tokens:Key"]))
                    };
                });

// Configure FormOptions for file uploads
builder.Services.Configure<FormOptions>(o =>
{
    o.ValueLengthLimit = int.MaxValue;
    o.MultipartBodyLengthLimit = int.MaxValue;
    o.MemoryBufferThreshold = int.MaxValue;
});

builder.Services.AddScoped<IUserClaimsPrincipalFactory<User>, AppUserClaimsPrincipalFactory>();

builder.Services.Configure<DataProtectionTokenProviderOptions>(options => options.TokenLifespan = TimeSpan.FromHours(3));

// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();

var app = builder.Build();

// Configure the HTTP request pipeline
if (app.Environment.IsDevelopment())
{
    app.UseSwagger();
    app.UseSwaggerUI();
}

// Use CORS
app.UseCors("AllowAll");

app.UseHttpsRedirection();
app.UseAuthentication();
app.UseAuthorization();

app.MapControllers();

app.Use(async (context, next) =>
{
    var logger = app.Services.GetRequiredService<ILogger<Program>>();
    logger.LogInformation("Handling request: " + context.Request.Path);
    await next.Invoke();
    logger.LogInformation("Finished handling request.");
});

app.Run();
import requests
import json
import sys
sys.path.append('/Workspace/Users/khoa.nguyen@houstontexans.com/production_jobs/Data_Ops_Tools')
import EnvVars
from EnvVars import env_vars_dict


apigeeKey = env_vars_dict['tm']['apiKey']
eventName = '23COPAST'
startDateTime = '2023-07-26 12:00'

url = "https://app.ticketmaster.com/sth-buy/ticketing_services.aspx?dsn=texans"

payload = {
  "header":{
    "src_sys_type":2,"ver":1
    ,"src_sys_name":"test"
    ,"archtics_version":"V999"
    },
  "command1":{
    "cmd":"get_attendance_incremental"
    ,"start_datetime":startDateTime
    ,"uid":"texans64"
    ,"dsn":"texans"
    ,"event_name":eventName
    }
  }

headers = {
  'apikey': apigeeKey, 
  'Content-Type': 'application/json',
  'Connection': 'keep-alive'
}

response = requests.post( url, headers=headers , json=payload)
data = response.json()
data
from datetime import datetime as dt , timedelta
print(len(os.listdir(processed_tm_sftp_files_root_dir)))

for f_dir in os.listdir(processed_tm_sftp_files_root_dir):
  folder_path = f"{processed_tm_sftp_files_root_dir}\{f_dir}"
  folder_date = f_dir.replace('texans_texans_texans_','').split('_')[0][:8]

  folder_date = dt.strptime(folder_date,'%Y%m%d')

  if folder_date < dt.today() - timedelta(days=120):

    for f in os.listdir(folder_path):
      file_path = f"{folder_path}\{f}"
      if os.path.isfile(file_path):
        os.remove(file_path)
        print(f"Deleted file: {file_path}")
import pandas as pd
 
sheets_dict = pd.read_excel('Book1.xlsx', sheetname=None)
 
full_table = pd.DataFrame()
for name, sheet in sheets_dict.items():
    sheet['sheet'] = name
    sheet = sheet.rename(columns=lambda x: x.split('\n')[-1])
    full_table = full_table.append(sheet)
 
full_table.reset_index(inplace=True, drop=True)
 
print full_table
import sys 
sys.path.append ('/Workspace/Users/khoa.nguyen@houstontexans.com/production_jobs/Data_Ops_Tools/') 

import EnvVars
from EnvVars import *

dev_credentials = env_vars_dict['azure_storage_dev']

from azure.storage.blob import BlobServiceClient , BlobClient

# Replace the following variables with your Azure Storage account and container information
storage_account_name = dev_credentials['accountName']
storage_account_key = dev_credentials['secretValue']
container_name = "raw"
directory_name = "PSL/"  # Leave empty to list files from the root of the container

mount_name = 'PSL'
directory_path = 'PSL'


dbutils.fs.mount(
  source=f"wasbs://{container_name}@{storage_account_name}.blob.core.windows.net/{directory_path}",
  mount_point=f"/mnt/azure_storage/{mount_name}",
  extra_configs={
    f"fs.azure.account.key.{storage_account_name}.blob.core.windows.net": storage_account_key
  }
)

# List all mount points
mounts = dbutils.fs.mounts()
## Date Formatting 

#### Sql
```sql
date_format(dt_obj, 'yyyy-MM-dd hh:mm:ss a') 
```

#### Python
```python
dt_obj.strftime("%-m-%d-%Y %-I:%M%p")
```
---
qry = """
SELECT COUNT(*) CNT , 'eloqua_contact' AS tbl
FROM reporting.eloqua_contact
UNION 
SELECT COUNT(*) CNT , 'eloqua_form' AS tbl
FROM reporting.eloqua_form
UNION 
SELECT COUNT(*) CNT , 'eloqua_form_submission' AS tbl
FROM reporting.eloqua_form_submission
UNION
SELECT COUNT(*) CNT , 'eloqua_system_preference_center' AS tbl
FROM reporting.eloqua_system_preference_center
UNION
SELECT COUNT(*) CNT , 'eloqua_system_sms_preference_center' AS tbl
FROM reporting.eloqua_system_sms_preference_center
UNION 
SELECT COUNT(*) CNT , 'eloqua_system_preference_center_toro_s_kids_club' AS tbl
FROM reporting.eloqua_system_preference_center_toro_s_kids_club
UNION
SELECT COUNT(*) CNT , 'eloqua_system_preference_center_historic' AS tbl
FROM reporting.eloqua_system_preference_center_historic
UNION
SELECT COUNT(*) CNT , 'eloqua_system_bi_prospect_scores' AS tbl
FROM reporting.eloqua_system_bi_prospect_scores

"""

# Get Pre Run Cnts
pre_run_df = spark.read.format("sqlserver")\
      .option("host", "sqls-houstontexans-db-01.database.windows.net")\
      .option("user", prodProperties['user']).option("password", prodProperties['password'])\
      .option("database","sqls-houstontexans")\
      .option("query", qry)\
      .option("fetchSize", 35000)\
      .load()
 
# write data from dbrix to azure
prod_dbrix_to_azure('eloqua.contact','reporting.eloqua_contact')
prod_dbrix_to_azure('eloqua.form','reporting.eloqua_form')
prod_dbrix_to_azure('eloqua.form_submission','reporting.eloqua_form_submission')
prod_dbrix_to_azure('eloqua.system_preference_center','reporting.eloqua_system_preference_center')
prod_dbrix_to_azure('eloqua.system_sms_preference_center','reporting.eloqua_system_sms_preference_center')
prod_dbrix_to_azure('eloqua.system_preference_center_toro_s_kids_club','reporting.eloqua_system_preference_center_toro_s_kids_club')
prod_dbrix_to_azure('eloqua.system_preference_center_historic','reporting.eloqua_system_preference_center_historic')
prod_dbrix_to_azure('eloqua.system_bi_prospect_scores','reporting.eloqua_system_bi_prospect_scores')

# Get Post Run Cnts
post_run_df = spark.read.format("sqlserver")\
      .option("host", "sqls-houstontexans-db-01.database.windows.net")\
      .option("user", prodProperties['user']).option("password", prodProperties['password'])\
      .option("database","sqls-houstontexans")\
      .option("query", qry)\
      .option("fetchSize", 35000)\
      .load()
      
# Compare Pre and Post Run Df 
pre_post_cnts_df = pre_run_df.join(post_run_df, on='tbl', how='inner').select(pre_run_df.tbl ,  pre_run_df.CNT.alias('pre_run_cnt'), post_run_df.CNT.alias('post_run_cnt'))
pre_post_cnts_df.display()
import sys 
sys.path.append ('/Workspace/Users/khoa.nguyen@houstontexans.com/production_jobs/Data_Ops_Tools/')
from DataOpsMainFunctions import prod_azure_to_dbrix, prod_dbrix_to_azure , prodProperties

query_azure_db_df = spark.read.format("sqlserver")\
      .option("host", "sqls-houstontexans-db-01.database.windows.net")\
      .option("user", prodProperties['user']).option("password", prodProperties['password'])\
      .option("database","sqls-houstontexans")\
      .option("query", "SELECT * FROM reporting.db_data_catalogue WHERE table_schema='survey_monkey'")\
      .option("fetchSize", 35000)\
      .load()
query_azure_db_df.display()
import React, {
  ChangeEvent,
  useEffect,
  useLayoutEffect,
  useRef,
  useState,
} from "react";
import { AttachCreatedFile, IDisplayComponentRef } from "./DisplayComponent";
import { Components, PropNames } from "./Components";
import {
  ComponentTitle,
  Container,
  GridItem,
  Label,
  TextInput,
  WideGridItem,
  WideTextInput,
  WideTextArea,
} from "./EditComponents";
import Repository from "../../common/repository/repository";
import config from "../../config.json";
import { ColorSelector } from "./ColorSelector";
import {
  AssetType,
  IAsset,
  IDirection,
  IObjectFit,
  ITemperatureType,
  IAnimatedDrmDotPosition,
  AssetNames,
} from "../../digital_assets_management/interfaces/IAsset";
import { useTranslations } from "../../i18n/useTranslations";
import { Input } from "reactstrap";
import { ThumbnailModal } from "../../common/components/ThumbnailModal";
import * as Constants from "../constants/component-constants";
import * as Global_Constants from "../../common/constants/shared-constants";
import * as Property_Constants from "../../common/constants/property-constants";
interface IComponentProps {
  component: IDisplayComponentRef | null;
  configuration: any;
  onValueChanged: (x: number, y: number, width: number, height: number) => void;
  onDeleteComponent?: (c: string) => void;
  onDuplicateComponent?: (c: IDisplayComponentRef) => void;
}
export const ComponentPropertyBar = ({
  component,
  configuration,
  onValueChanged,
  onDeleteComponent,
  onDuplicateComponent,
}: IComponentProps) => {
  const [checked, setChecked] = useState(true);
  const [isPlaying, setIsPlaying] = useState(false);
  const [align, setAlign] = useState("");
  const [extraProps, setExtraProps] = useState(
    {} as { [key: string]: any | number | boolean }
  );
  const refX = useRef<any>();
  const refY = useRef<any>();
  const refW = useRef<any>();
  const refH = useRef<any>();
  const i18n = useTranslations();
  const [createdFile, setCreatedFile] = useState({
    name: "",
    fileptr: Global_Constants.NOT_A_FP,
  } as AttachCreatedFile);
  const [styleAssets, setStyleAssets] = useState<IAsset[]>([]);
  const [arrowImage, setArrowImage] = useState<string | undefined>(undefined);
  const [imageAssets, setImageAssets] = useState<IAsset[]>([]);
  const [videoAssets, setVideoAssets] = useState<IAsset[]>([]);
  const [multiTextChecked, setMultiTextChecked] = useState(false);
  const [direction, setDirection] = useState<string>("left");
  const directionOptional = useRef([
    IDirection.LEFT,
    IDirection.RIGHT,
    IDirection.UP,
    IDirection.DOWN,
  ]);
  const [fitObject, setFitObject] = useState<string>();
  const objectsFitOptions = useRef([
    IObjectFit.CONTAIN,
    IObjectFit.COVER,
    IObjectFit.fill,
  ]);
  const [, setTempartureType] = useState();
  const tempartureTypesOptions = useRef([
    ITemperatureType.CELSIUS,

    ITemperatureType.FAHRENHEIT,
  ]);
  const [temperatureUnit, setTemperatureUnit] = useState<string>();
  const [ddrInputEvents, setDDRInputEvents] = useState<string>();
  const [animatedDrmDotOptionValue, setAnimatedDrmDotOptionValue] =
    useState("default");
  const animatedDrmDotPosition = useRef([
    IAnimatedDrmDotPosition.DEFAULT,
    IAnimatedDrmDotPosition.UPPER,
    IAnimatedDrmDotPosition.LOWER,
    IAnimatedDrmDotPosition.ZIGZAG,
  ]);
  const [showImageModal, setShowImageModal] = useState(false);
  const openImageModal = () => {
    setShowImageModal(true);
  };
  const closeImageModal = () => {
    setShowImageModal(false);
  };
  const [searchQuery, setSearchQuery] = useState("");
  const [numStations, setNumStations] = useState(2); // Default number of stations
  const [numberofArrows, setArrowIndex] = useState(0);
  const [fontOptions, setFontOptions] = useState([]);
  const [selectedFont, setSelectedFont] = useState("");
  const dataChanged = () => {
    const bounds = component!.getBounds();
    let x = parseInt(refX.current!.value);
    x = isNaN(x) ? bounds.x : x;
    let y = parseInt(refY.current!.value);
    y = isNaN(y) ? bounds.y : y;
    let width = parseInt(refW.current!.value);
    width = isNaN(width) ? bounds.width : width;
    let height = parseInt(refH.current!.value);
    height = isNaN(height) ? bounds.height : height;
    onValueChanged(x, y, width, height);
  };
  useEffect(() => {
    if (extraProps.direction) {
      setDirection(extraProps.direction.toString());
    } else {
      setDirection("left");
    }
  }, [extraProps.direction]);

  useEffect(() => {
    setExtraProps({});
    if (!component) return;
    const bounds = component.getBounds();
    setValue(refX.current!, Math.round(bounds.x));
    setValue(refY.current!, Math.round(bounds.y));
    setValue(refW.current!, Math.round(bounds.width));
    setValue(refH.current!, Math.round(bounds.height));
    const props = component.getExtraProps();
    if (props) {
      setExtraProps(props);
      setChecked(props[Property_Constants.IS_ANIMATED]);
      setAlign(props[Property_Constants.ALIGNMENT]);
      setIsPlaying(props[Property_Constants.IS_PLAYING]);
      setMultiTextChecked(props[Constants.MULTI_LINE_TEXT]);
      setFitObject(props[Constants.OBJECT_FIT]);
      setTempartureType(props[Property_Constants.TEMPERATURE_TYPE]);
      setDDRInputEvents(props[Property_Constants.DDR_EVENTS]);
      setNumStations(props[Property_Constants.NUM_STATIONS]);
      setArrowIndex(props[Property_Constants.NUMBER_OF_ARROWS]);
    }
    const attachedFile = component.getCreatedFile();
    if (attachedFile) {
      setCreatedFile(attachedFile);
    }
  }, [component]);
  useEffect(() => {
    const retreiveAssets = async () => {
      const styleAssets = (
        await Repository.getInstance().getAssets(0, 0, "", AssetType.Style)
      ).items;
      setStyleAssets(styleAssets);

      const imageAssets = (
        await Repository.getInstance().getAssets(0, 0, "", AssetType.Image)
      ).items;
      setImageAssets(imageAssets);

      const videoAssets = (
        await Repository.getInstance().getAssets(0, 0, "", AssetType.Video)
      ).items;
      setVideoAssets(videoAssets);
    };

    retreiveAssets();
  }, []);
  const setValue = (el: HTMLInputElement, value: number) => {
    el.value = value.toString();
  };
  const animateChanged = (t: HTMLInputElement) => {
    const newValue = t.checked;
    setChecked(newValue);
    const props = { ...extraProps, isAnimated: newValue };
    setExtraProps(props);
    component!.setExtraProps(props);
  };
  const multiLineChanged = (t: HTMLInputElement) => {
    const newValue = t.checked;
    setMultiTextChecked(newValue);
    const props = { ...extraProps, multiLineText: newValue };
    setExtraProps(props);
    component!.setExtraProps(props);
  };

  const changeAnimationDirection = (t: React.ChangeEvent<HTMLInputElement>) => {
    const newValue = t.target.value;
    setDirection(newValue);
    const props = { ...extraProps, direction: newValue };
    setExtraProps(props);
    component!.setExtraProps(props);
  };

  const handleTemperatureChange = (t: React.ChangeEvent<HTMLInputElement>) => {
    const newValue = t.target.value;
    const props = { ...extraProps, temperatureScales: newValue };
    setTemperatureUnit(newValue);
    setExtraProps(props);
    component!.setExtraProps(props);
  };
  const handleDotOptionChange = (t: React.ChangeEvent<HTMLInputElement>) => {
    const newValue = t.target.value;
    setAnimatedDrmDotOptionValue(newValue);
    const props = { ...extraProps, animatedDrmDotOptionValue: newValue };
    setExtraProps(props);
    component!.setExtraProps(props);
  };

  const handleFileUploadChange = (
    event: React.ChangeEvent<HTMLInputElement>
  ) => {
    const file = event.target.files?.[0];
    if (file) {
      const reader = new FileReader();
      reader.onload = (e) => {
        const uploadedFile = e.target?.result as string;
        // Set uploaded file as background image
        setArrowImage(uploadedFile);
      };
      reader.readAsDataURL(file);
    }
  };

  const changeProp = (
    propName: string,
    propValue: string | number | boolean
  ) => {
    const currentValue = extraProps[propName];
    if (currentValue !== propValue) {
      const props = { ...extraProps, [propName]: propValue };
      setExtraProps(props);
      component!.setExtraProps(props);
    }
  };

  const propChanged = (e: ChangeEvent<HTMLInputElement>) => {
    const propName = e.target.id.toString().substring(5);
    const newValue =
      typeof extraProps[propName] === "number"
        ? +e.target.value
        : typeof extraProps[propName] === "boolean"
        ? e.target.checked
        : e.target.value;

    changeProp(propName, newValue);
  };

  const propChangedForTextarea = (e: ChangeEvent<HTMLTextAreaElement>) => {
    const propName = e.target.id.toString().substring(5);
    const newValue = e.target.value;
    changeProp(propName, newValue);
  };

  const alignChanged = (e: ChangeEvent<HTMLInputElement>) => {
    const propName = e.target.id.toString().split("-")[1];
    const newValue = e.target.value;
    setAlign(newValue);
    changeProp(propName, newValue);
  };

  const changeInputDDREventState = (e: React.ChangeEvent<HTMLInputElement>) => {
    const ddrValue = e.target.value;
    const props = { ...extraProps, ddrEvents: ddrValue };
    setDDRInputEvents(ddrValue);
    setExtraProps(props);
    component!.setExtraProps(props);
  };

  const changeComponetObjectFit = (e: React.ChangeEvent<HTMLInputElement>) => {
    const targetValue = e.target.value;
    const props = { ...extraProps, objectFit: targetValue };
    setFitObject(targetValue);
    setExtraProps(props);
    component!.setExtraProps(props);
  };

  const handleStationChange = (e: React.ChangeEvent<HTMLInputElement>) => {
    //  const newNumStations = +e.target.value;
    const newNumStations = parseInt(e.target.value);
    setNumStations(newNumStations);
    // Ensure arrow index doesn't exceed the number of stations
    setArrowIndex(Math.min(numberofArrows, newNumStations - 1));
    const props = { ...extraProps, numStations: newNumStations };
    setExtraProps(props);
    component!.setExtraProps(props);
  };

  const handleArrowChange = (e: React.ChangeEvent<HTMLInputElement>) => {
    const newArrowIndex = Number(e.target.value);
    setArrowIndex(Math.max(0, Math.min(newArrowIndex, numStations - 1)));
    const props = { ...extraProps, numberofArrows: newArrowIndex };
    setExtraProps(props);
    component!.setExtraProps(props);
  };

  const changeComponentAssetSelector = (
    e: React.ChangeEvent<HTMLInputElement>,
    assetType: string | undefined
  ) => {
    let createdFile = {
      name: "",
      fileptr: Global_Constants.NOT_A_FP,
    } as AttachCreatedFile;
    let props = extraProps;
    if (e.target.value === Global_Constants.NOT_A_FP) {
      setCreatedFile(createdFile);
      return;
    }

    if (assetType === AssetType.Style) {
      const asset = styleAssets?.find((v) => v.file_pointer === e.target.value);
      if (!asset) return;
      props = { ...props, style: asset?.infoJson ?? "{}" };
      createdFile = {
        name: asset.name,
        fileptr: asset.file_pointer,
      } as AttachCreatedFile;
    } else {
      const asset =
        assetType === AssetType.Image
          ? imageAssets?.find((v) => v.file_pointer === e.target.value)
          : videoAssets?.find((v) => v.file_pointer === e.target.value);
      if (!asset) return;
      props = {
        ...extraProps,
        src: `${config.assetsUrl}/${asset.file_pointer}`,
        source: asset.name,
      };
      createdFile = {
        name: asset.name,
        fileptr: asset.file_pointer,
      } as AttachCreatedFile;
      if (assetType === AssetType.Video) {
        const bounds = component!.getBounds();
        const newSize = JSON.parse(asset.infoJson);
        component!.setBounds({
          ...bounds,
          width: newSize["width"],
          height: newSize["height"],
        });
      }
    }

    setExtraProps(props);
    component!.setExtraProps(props);
    setCreatedFile(createdFile);
    component!.setCreatedFile(createdFile);
  };

  function updateMultilanguage(locale: string, duration: any) {
    let multiLanguage = JSON.parse(
      String(extraProps[Property_Constants.MULTI_LANGUAGE])
    );
    multiLanguage = {
      ...multiLanguage,
      [locale]: { ...multiLanguage[locale], duration: duration },
    };
    return multiLanguage;
  }

  const handleMultilingualCheckboxChange = (
    e: any,
    localecode: string,
    sampleMessage: string
  ) => {
    const sortedLocales = [...configuration.medialocales.locales].sort(
      (a, b) => a.order - b.order
    );
    const allLocales = sortedLocales.map((item: any) => item.localecode);
    let multiLanguage = JSON.parse(
      String(extraProps[Property_Constants.MULTI_LANGUAGE])
    );

    const currentLocaleIndex = allLocales.indexOf(localecode);

    for (
      let index = currentLocaleIndex + 1;
      index < allLocales.length;
      index++
    ) {
      const nextLocale = allLocales[index];
      if (!e.target.checked) {
        if (multiLanguage[nextLocale].checked) {
          const nextLocaleDuration =
            parseInt(multiLanguage[nextLocale][Property_Constants.DURATION]) +
            parseInt(multiLanguage[localecode][Property_Constants.DURATION]);
          multiLanguage = updateMultilanguage(nextLocale, nextLocaleDuration);
          break;
        }
      } else {
        if (multiLanguage[nextLocale].checked) {
          let nextLocaleDuration =
            parseInt(multiLanguage[nextLocale][Property_Constants.DURATION]) -
            parseInt(multiLanguage[localecode][Property_Constants.DURATION]);
          nextLocaleDuration = Math.max(nextLocaleDuration, 0);
          multiLanguage = updateMultilanguage(nextLocale, nextLocaleDuration);
          break;
        }
      }
    }
    multiLanguage = {
      ...multiLanguage,
      [localecode]: {
        ...multiLanguage[localecode],
        id: localecode,
        sampleText: sampleMessage,
        checked: e.target.checked,
      },
    };
    const props = {
      ...extraProps,
      [Property_Constants.MULTI_LANGUAGE]: JSON.stringify(multiLanguage),
    };
    setExtraProps(props);
    component!.setExtraProps(props);
  };

  const handleDurationsInputChange = (
    event: React.ChangeEvent<HTMLInputElement>,
    locale: string
  ) => {
    const { value } = event.target;
    const multiLanguage = updateMultilanguage(locale, value);
    const props = {
      ...extraProps,
      [Property_Constants.MULTI_LANGUAGE]: JSON.stringify(multiLanguage),
    };
    setExtraProps(props);
    component!.setExtraProps(props);
  };

  const onMultilanguageTextChanged = (e: ChangeEvent<HTMLTextAreaElement>) => {
    const propName = e.target.id.toString().split("-")[1];
    const newValue = e.target.value;
    let multiLanguage = JSON.parse(
      String(extraProps[Property_Constants.MULTI_LANGUAGE])
    );
    multiLanguage = {
      ...multiLanguage,
      [propName]: {
        id: propName,
        sampleText: newValue,
        checked: true,
        duration: multiLanguage[propName][Property_Constants.DURATION],
      },
    };
    const props = {
      ...extraProps,
      [Property_Constants.MULTI_LANGUAGE]: JSON.stringify(multiLanguage),
    };
    setExtraProps(props);
    component!.setExtraProps(props);
  };

  const toProperCase = (s: string) => s.charAt(0).toUpperCase() + s.slice(1);

  const playPause = () => {
    const newValue = !isPlaying;
    setIsPlaying(newValue);
    changeProp(Property_Constants.IS_PLAYING, newValue);
    document
      .getElementById("icon-play")!
      .setAttribute("class", `fa fa-fw ${newValue ? "fa-pause" : "fa-play"}`);
  };

  const hiddenProps = [
    Property_Constants.SOURCE,
    Property_Constants.SRC,
    Property_Constants.IS_PLAYING,
    Constants.MULTI_LINE_TEXT,
    Constants.OBJECT_FIT,
    Property_Constants.TEMPERATURE_SCALES,
    Property_Constants.INPUT_BOX,
  ];

  const radioChanged = () => {
    //
  };

  const alignmentInput = (p: string, propId: string): JSX.Element => {
    return (
      <WideGridItem className="px-2" key={p}>
        <label>
          {i18n(Global_Constants.SCENE_LOCALES, PropNames[p]?.displayText) ??
            toProperCase(p)}
        </label>
        <div onChange={alignChanged} className="d-flex justify-content-between">
          <div>
            <input
              type="radio"
              id={propId + "-left"}
              value="left"
              checked={align === "left"}
              onChange={radioChanged}
            />
            <i className="fa fa-align-left mx-1" />
          </div>
          <div>
            <input
              type="radio"
              id={propId + "-center"}
              value="center"
              checked={align === "center"}
              onChange={radioChanged}
            />
            <i className="fa fa-align-center mx-1" />
          </div>
          <div>
            <input
              type="radio"
              id={propId + "-right"}
              value="right"
              checked={align === "right"}
              onChange={radioChanged}
            />
            <i className="fa fa-align-right mx-1" />
          </div>
        </div>
      </WideGridItem>
    );
  };

  const styleInput = (p: string, propId: string): JSX.Element => (
    <WideGridItem key="style">
      <Label htmlFor="prop-source" accessKey="s">
        {i18n(Global_Constants.GLOBAL, Global_Constants.STYLE)}
      </Label>
      <Input
        type="select"
        value={createdFile.fileptr}
        onChange={(e) => changeComponentAssetSelector(e, AssetType.Style)}
        id="comp-text-style-sel"
        name="comp-text-style-sel"
        title="Text Style selector"
        className="comp-textStyle-select"
      >
        <option value="_not_a_fp__" key="non_comp-text-style-id">
          {i18n(Global_Constants.SCENE_LOCALES, Constants.CHOOSE_STYLE)}
        </option>
        {styleAssets?.map((sa) => (
          <option
            key={`comp-text-style-id-${sa.file_pointer}`}
            value={sa.file_pointer}
          >
            {sa.name}
          </option>
        ))}
      </Input>
    </WideGridItem>
  );

  const DynamicField = (p: string) => {
    const renderFields = () => {
      const sortedLocales = [...configuration.medialocales.locales].sort(
        (a, b) => a.order - b.order
      );
      const multiLanguageText = JSON.parse(String(extraProps[p]));
      const inputBox = Boolean(extraProps.inputBox);
      const fields = sortedLocales.map((item: any) => {
        const { title, sampleText, localecode } = item;
        const languageTextObj =
          multiLanguageText && multiLanguageText[localecode]
            ? multiLanguageText[localecode]
            : {
                id: localecode,
                sampleText: sampleText,
                checked: true,
                duration: "4",
              };
        if (!multiLanguageText[localecode]) {
          multiLanguageText[localecode] = languageTextObj;
          const props = {
            ...extraProps,
            [p]: JSON.stringify(multiLanguageText),
          };
          setExtraProps(props);
          component!.setExtraProps(props);
        }
        return getInputWithCheckboxComponent(
          `${p}-${localecode}`,
          `multilanguage-${localecode}`,
          multiLanguageText[localecode].sampleText,
          onMultilanguageTextChanged,
          null,
          multiLanguageText[localecode].checked,
          title,
          inputBox,
          multiLanguageText[localecode].duration
        );
      });
      return fields;
    };
    return <>{renderFields()}</>;
  };

  const handleDropdownChange = (
    e: React.ChangeEvent<HTMLInputElement>,
    component: any,
    p: string,
    index: number
  ) => {
    const newValue = e.target.value;
    const updatedDropdown = extraProps.dropdown.map(
      (dropdownItem: any, idx: number) => {
        if (idx === index) {
          return { ...dropdownItem, selectedValue: newValue };
        }
        return dropdownItem;
      }
    );

    const props = {
      ...extraProps,
      dropdown: updatedDropdown,
    };
    setExtraProps(props);
    component!.setExtraProps(props);
  };

  const createDropdown = (p: string, component: any) => {
    const renderFields = () => {
      if (!Array.isArray(extraProps.dropdown)) {
        return null;
      }

      return extraProps.dropdown.map((dropdownItem: any, index: number) => {
        const dropdownData: any =
          Components[component.componentType].properties?.[dropdownItem.name];
        const dropdownOptions = dropdownData?.options || [];
        const selectedValue = dropdownItem.selectedValue;

        return (
          <WideGridItem key={index}>
            <Label
              htmlFor={`${component.componentType}${dropdownItem.name}Dropdown`}
            >
              {i18n(Global_Constants.SCENE_LOCALES, dropdownItem.name)}
            </Label>
            <Input
              type="select"
              onChange={(e) => handleDropdownChange(e, component, p, index)}
              className="animation-direction text-capitalize"
              value={selectedValue}
            >
              {dropdownOptions.map((value: any, idx: number) => (
                <option key={idx} value={value}>
                  {value}
                </option>
              ))}
            </Input>
          </WideGridItem>
        );
      });
    };

    return <>{renderFields()}</>;
  };

  const getInputWithCheckboxComponent = (
    pElementkey: string,
    propId: string,
    inputValue: string,
    onChangeHandler: any,
    numberProps: any,
    isChecked: boolean,
    label: string,
    inputBox: boolean,
    duration: any
  ) => {
    return (
      <WideGridItem key={pElementkey}>
        <Label htmlFor={propId} accessKey={PropNames[pElementkey]?.accessKey}>
          {label
            ? label
            : i18n(
                Global_Constants.SCENE_LOCALES,
                PropNames[pElementkey]?.displayText
              ) ?? toProperCase(pElementkey)}
          <input
            className="check-multilang"
            id={propId}
            key={`checkbox-${propId}`}
            checked={isChecked}
            onChange={(e) =>
              handleMultilingualCheckboxChange(
                e,
                propId.split("-")[1],
                inputValue
              )
            }
            type="checkbox"
          />
          {inputBox && (
            <input
              type="number"
              id={`text-${propId}`}
              key={`text-${propId}`}
              min={0}
              max={3600}
              style={{
                width: "50px",
                border: "1px solid black",
                borderRadius: "5px",
                marginLeft: "5px",
                marginBottom: "2px",
              }}
              value={duration}
              onChange={(e) =>
                handleDurationsInputChange(e, propId.split("-")[1])
              }
            />
          )}
        </Label>
        <WideTextArea
          id={propId}
          value={inputValue}
          onChange={onChangeHandler}
          {...numberProps}
        />
      </WideGridItem>
    );
  };

  const textInput = (
    p: string,
    propId: string,
    inputType: string
  ): JSX.Element => {
    let numberProps = {};
    if (
      component &&
      component.componentType === Constants.COMPONENT_TYPE_MULTILINE_TEXT
    ) {
      numberProps = { min: 1, max: 3 };
    }
    return propId === "prop-text" ? (
      <WideGridItem key={p}>
        <Label htmlFor={propId} accessKey={PropNames[p]?.accessKey}>
          {i18n(Global_Constants.SCENE_LOCALES, PropNames[p]?.displayText) ??
            toProperCase(p)}
        </Label>
        <WideTextArea
          id={propId}
          value={extraProps[p].toString()}
          onChange={propChangedForTextarea}
          {...numberProps}
        />
      </WideGridItem>
    ) : propId === "prop-ddrEvents" ? (
      <WideGridItem key={p}>
        <Label htmlFor={propId} accessKey={PropNames[p]?.accessKey}>
          {i18n(Global_Constants.SCENE_LOCALES, PropNames[p]?.displayText) ??
            toProperCase(p)}
        </Label>
        <WideTextInput
          id={propId}
          value={ddrInputEvents}
          placeholder={i18n(
            Global_Constants.SCENE_LOCALES,
            Constants.ENTER_DDR_VAR_NAMES
          )}
          onChange={changeInputDDREventState}
          {...numberProps}
        />
      </WideGridItem>
    ) : propId == "prop-numStations" ? (
      <WideGridItem key={p}>
        <Label htmlFor={propId} accessKey={PropNames[p]?.accessKey}>
          {i18n(Global_Constants.SCENE_LOCALES, PropNames[p]?.displayText) ??
            toProperCase(p)}
        </Label>
        <WideTextInput
          id={propId}
          type="number"
          className="numarrows"
          value={numStations}
          min={2}
          onChange={handleStationChange}
          {...numberProps}
        />
      </WideGridItem>
    ) : propId == "prop-numberofArrows" ? (
      <WideGridItem key={p}>
        <Label htmlFor={propId} accessKey={PropNames[p]?.accessKey}>
          {i18n(Global_Constants.SCENE_LOCALES, PropNames[p]?.displayText) ??
            toProperCase(p)}
        </Label>
        <WideTextInput
          id={propId}
          type="number"
          value={numberofArrows}
          className="numarrows"
          max={numStations - 1}
          min={0}
          onChange={handleArrowChange}
          {...numberProps}
        />
      </WideGridItem>
    ) : propId !== "prop-direction" ? (
      <WideGridItem key={p}>
        <Label htmlFor={propId} accessKey={PropNames[p]?.accessKey}>
          {i18n(Global_Constants.SCENE_LOCALES, PropNames[p]?.displayText) ??
            toProperCase(p)}
        </Label>
        <WideTextInput
          id={propId}
          value={extraProps[p].toString()}
          onChange={propChanged}
          {...numberProps}
        />
      </WideGridItem>
    ) : (
      <></>
    );
  };

  return component ? (
    <Container>
      <ComponentTitle>
        {i18n(
          Global_Constants.SCENE_LOCALES,
          Components[component.componentType].displayName
        )}
      </ComponentTitle>
      <GridItem>
        <Label htmlFor="prop-x" accessKey="x">
          x
        </Label>
        <TextInput
          id="prop-x"
          ref={refX}
          onChange={dataChanged}
          type="number"
        />
      </GridItem>
      <GridItem>
        <Label htmlFor="prop-y" accessKey="y">
          y
        </Label>
        <TextInput
          id="prop-y"
          ref={refY}
          onChange={dataChanged}
          type="number"
        />
      </GridItem>
      <GridItem>
        <Label htmlFor="prop-width" accessKey="l">
          {i18n(
            Global_Constants.SEQUENCE_LOCALES,
            PropNames["width"]?.displayText
          ) ?? "Width"}
        </Label>
        <TextInput
          id="prop-width"
          ref={refW}
          onChange={dataChanged}
          type="number"
          readOnly={component.componentType === "Video"}
        />
      </GridItem>
      <GridItem>
        <Label htmlFor="prop-height" accessKey="h">
          {i18n(
            Global_Constants.SEQUENCE_LOCALES,
            PropNames["height"]?.displayText
          ) ?? "Height"}
        </Label>
        <TextInput
          id="prop-height"
          ref={refH}
          onChange={dataChanged}
          type="number"
        />
      </GridItem>

      {component && Components[component.componentType].canAnimate ? (
        <WideGridItem className="form-check form-switch">
          <input
            className="form-check-input"
            onChange={(e) => animateChanged(e.target)}
            type="checkbox"
            id="checkAnimate"
            checked={checked}
          />
          <label
            className="form-check-label"
            htmlFor="checkAnimate"
            accessKey="a"
          >
            {i18n(Global_Constants.SCENE_LOCALES, Constants.ANIMATE)}
          </label>
        </WideGridItem>
      ) : (
        <></>
      )}

      {Components[component.componentType].assetType ===
      AssetType.AnimatedDrmDropdown ? (
        <WideGridItem>
          <Label htmlFor="animatedDrmDropdown" accessKey="d">
            Line Style
          </Label>

          <Input
            type="select"
            onChange={(e) => handleDotOptionChange(e)}
            className="animation-direction text-capitalize"
            value={animatedDrmDotOptionValue}
          >
            {animatedDrmDotPosition.current.map((value, index) => (
              <option key={index} value={value}>
                {value}
              </option>
            ))}
          </Input>
        </WideGridItem>
      ) : (
        <></>
      )}

      {Components[component.componentType].assetNames ===
      AssetNames.AT_DotsDropdown ? (
        <WideGridItem>
          <Label htmlFor="DotsDropdown" accessKey="d">
            Arrow Type{" "}
          </Label>

          <input
            type="file"
            id="fileUpload"
            onChange={handleFileUploadChange}
          />
        </WideGridItem>
      ) : (
        <></>
      )}

      {component && Components[component.componentType].canMultiLine ? (
        <WideGridItem className="form-check form-switch">
          <input
            className="form-check-input"
            onChange={(e) => multiLineChanged(e.target)}
            type="checkbox"
            id="multiLine"
            checked={multiTextChecked}
          />
          <label className="form-check-label" htmlFor="multiLine" accessKey="m">
            {i18n(Global_Constants.SCENE_LOCALES, Constants.MULTI_LINE_TEXT)}
          </label>
        </WideGridItem>
      ) : (
        <></>
      )}

      {extraProps &&
        Object.keys(extraProps)
          .filter((p) => p !== "isAnimated" && !hiddenProps.includes(p))
          .map((p) => {
            const inputType = p.toLowerCase().includes("color")
              ? "color"
              : typeof extraProps[p] === "number"
              ? "number"
              : "text";
            const propId = `prop-${p}`;
            return p.toLowerCase().includes("color") ? (
              <ColorSelector
                key={p}
                propId={propId}
                colorValue={extraProps[p].toString()}
                onColorChanged={(c) => changeProp(p, c)}
                component={component}
              />
            ) : typeof extraProps[p] === "boolean" ? (
              <WideGridItem className="form-check form-switch" key={p}>
                <input
                  className="form-check-input"
                  onChange={propChanged}
                  type="checkbox"
                  id={propId}
                />
                <label
                  className="form-check-label"
                  htmlFor={propId}
                  accessKey={PropNames[p]?.accessKey}
                >
                  {i18n(
                    Global_Constants.SCENE_LOCALES,
                    PropNames[p]?.displayText
                  ) ?? toProperCase(p)}
                </label>
              </WideGridItem>
            ) : p.toLowerCase() === "alignment" ? (
              alignmentInput(p, propId)
            ) : p.toLowerCase() === "style" ? (
              styleInput(p, propId)
            ) : p.toLowerCase() === "direction" ? (
              <WideGridItem>
                <Label htmlFor={propId} accessKey="s">
                  {i18n(
                    Global_Constants.SCENE_LOCALES,
                    PropNames[p]?.displayText
                  ) ?? toProperCase(p)}
                </Label>
                <Input
                  type="select"
                  onChange={(e) => changeAnimationDirection(e)}
                  id={propId}
                  name={propId}
                  className="animation-direction text-capitalize"
                  value={direction}
                >
                  {directionOptional.current.map((value, index) => (
                    <option key={index} value={value}>
                      {value}
                    </option>
                  ))}
                </Input>
              </WideGridItem>
            ) : p === "multilanguage" ? (
              DynamicField(p)
            ) : p === "dropdown" ? (
              createDropdown(p, component)
            ) : (
              textInput(p, propId, inputType)
            );
          })}

      {Components[component.componentType].assetType === "AT_Temprature" ? (
        <WideGridItem key="Type">
          <Label htmlFor="prop-Temperature" accessKey="t">
            Type
          </Label>
          <Input
            type="select"
            onChange={(e) => handleTemperatureChange(e)}
            id="prop-Temperature"
            name="Temprature"
            title="Type Temprature"
            className="comp-temprature-select"
            value={temperatureUnit}
          >
            {tempartureTypesOptions.current.map((item) => (
              <option key={item} value={item}>
                {item}
              </option>
            ))}
          </Input>
        </WideGridItem>
      ) : (
        Components[component.componentType].assetType &&
        Components[component.componentType].assetType !==
          AssetType.AnimatedDrmDropdown && (
          <WideGridItem key="Source">
            <Label htmlFor="prop-source" accessKey="s">
              Source
            </Label>
            {showImageModal && (
              <ThumbnailModal
                show={showImageModal}
                header="Select Resource"
                onCloseModal={closeImageModal}
                isOkVisible={false}
                isCanVisible={true}
                searchQuery={searchQuery}
                setSearchQuery={setSearchQuery}
                // eslint-disable-next-line @typescript-eslint/no-empty-function
                // onOkClick={() => {}}
                i18n={i18n}
              >
                <div
                  style={{
                    display: "flex",
                    flexWrap: "wrap",
                    overflowX: "hidden",
                    height: "100%",
                    width: "1100px",
                    minHeight: "600px",
                    minWidth: "1100px",
                    justifyContent: "center",
                  }}
                >
                  {(Components[component.componentType].assetType ===
                  AssetType.Image
                    ? imageAssets
                    : videoAssets
                  )
                    ?.filter((asset) =>
                      asset.name
                        .toLowerCase()
                        .includes(searchQuery.toLowerCase())
                    )
                    .map((asset) => (
                      <div
                        style={{
                          padding: "5px",
                          justifyContent: "center",
                          alignItems: "center",
                          flex: "0 0 250px",
                          marginRight: "20px",
                          marginBottom: "20px",
                          border: "5px solid black",
                          height: "250px",
                          position: "relative",
                          display: "flex",
                          flexDirection: "column",
                          paddingTop: "15px",
                        }}
                        key={asset.file_pointer}
                        onClick={() => {
                          const syntheticEvent = {
                            target: { value: asset.file_pointer },
                          } as React.ChangeEvent<HTMLInputElement>;
                          changeComponentAssetSelector(
                            syntheticEvent,
                            Components[component.componentType].assetType ===
                              AssetType.Image
                              ? AssetType.Image
                              : AssetType.Video
                          );
                          closeImageModal();
                        }}
                      >
                        <div
                          style={{
                            display: "flex",
                            justifyContent: "center",
                            alignItems: "center",
                            height: "100%",
                          }}
                        >
                          {Components[component.componentType].assetType ===
                          AssetType.Image ? (
                            <img
                              src={`${config.assetsUrl}/${asset.file_pointer}`}
                              alt={asset.name}
                              style={{
                                maxWidth: "150px",
                                maxHeight: "150px",
                                cursor: "pointer",
                                marginBottom: "10px",
                                alignSelf: "center",
                              }}
                            />
                          ) : (
                            <video
                              src={`${config.assetsUrl}/${asset.file_pointer}`}
                              style={{
                                maxWidth: "150px",
                                maxHeight: "150px",
                                cursor: "pointer",
                                marginBottom: "10px",
                                alignSelf: "center",
                              }}
                            />
                          )}
                        </div>
                        <p
                          style={{
                            textAlign: "center",
                            marginTop: "auto",
                            marginBottom: "0",
                            backgroundColor: "#548b8b",
                            padding: "5px",
                            color: "white",
                            fontWeight: "bold",
                            height: "50px",
                            width: "100%",
                            overflow: "auto",
                          }}
                        >
                          {asset.name}
                        </p>
                      </div>
                    ))}
                </div>
              </ThumbnailModal>
            )}
            <button className="btn btn-secondary" onClick={openImageModal}>
              {i18n(Global_Constants.SCENE_LOCALES, Constants.SELECT_RESOURCE)}
            </button>
          </WideGridItem>
        )
      )}

      {Components[component.componentType].assetType === AssetType.Image ? (
        <WideGridItem key="Object-fit">
          <Label htmlFor="prop-objectFit" accessKey="s">
            {i18n(Global_Constants.SCENE_LOCALES, Constants.OBJECT_FIT)}
          </Label>
          <Input
            type="select"
            name="prop-objectFit"
            id="prop-objectFit"
            title="ObjectFit"
            onChange={(e) => changeComponetObjectFit(e)}
            value={fitObject}
            className="text-capitalize"
          >
            {objectsFitOptions.current.map((item) => (
              <option className="text-capitalize" key={item} value={item}>
                {item}
              </option>
            ))}
          </Input>
        </WideGridItem>
      ) : (
        <></>
      )}

      {Components[component.componentType].assetType === AssetType.Video ? (
        <WideGridItem>
          <button className="btn btn-primary" onClick={playPause}>
            <i className="fa fa-play fa-fw" id="icon-play" />
          </button>
        </WideGridItem>
      ) : (
        <></>
      )}
      {onDeleteComponent && (
        <GridItem>
          <button
            className="btn btn-primary"
            onClick={() => onDeleteComponent(component.compId)}
          >
            <i className="fa fa-trash fa-fw" />
          </button>
        </GridItem>
      )}
      {onDuplicateComponent && (
        <GridItem>
          <button
            className="btn btn-success"
            onClick={() => onDuplicateComponent(component)}
          >
            <i className="fa fa-clone fa-fw" />
          </button>
        </GridItem>
      )}
    </Container>
  ) : (
    <div>
      {i18n(Global_Constants.SCENE_LOCALES, Constants.SELECT_COMPONENT)}
    </div>
  );
};
import { DDRPlaceholderSelector } from "../../../composition_riv/constants/RIV";
import {
  MultiLangListContainer,
  MultiLangListItemContainer,
  MultiLangTextContainer,
} from "../containers/Container";
import {
  MultiLangListContainerStyle,
  MultiLangListTextAnimationStyle,
  MultiLangTextContainerStyle,
} from "../styles/InlineStyles";
import { useEffect, useState } from "react";

export interface IMlTextProps {
  fontSize: number;
  style: string;
  color?: string;
  multilanguage: string;
  multiLineText?: boolean;
  direction: string;
  speed: number;
}

export interface IMultilingualText {
  sampleText: any;
  localecode: any;
}

export const MlFreeTextMessage = ({
  multilanguage,
  multiLineText,
  fontSize,
  style,
  color,
  direction,
}: IMlTextProps) => {
  const [previous, setPrevious] = useState(multilanguage);
  const [languages, setLanguages] = useState<IMultilingualText[]>([]);
  const [previousDirection, setPreviousDirection] = useState(direction);
  useEffect(() => {
    if (previous !== multilanguage || direction !== previousDirection) {
      populateLanguageList();
    }
  }, [multilanguage, previousDirection]);

  useEffect(() => {
    if (previousDirection !== direction) {
      setPreviousDirection(direction);
    }
  }, [direction]);

  useEffect(() => {
    if (multilanguage) {
      populateLanguageList();
    }
  }, []);

  function populateLanguageList() {
    setPrevious(multilanguage);
    const language = renderMultilanguageText() || [];
    setLanguages(language);
  }

  function renderMultilanguageText(): IMultilingualText[] {
    const previousTextInfo = JSON.parse(String(multilanguage));
    return (
      Object.keys(previousTextInfo)
        .filter((lang) => previousTextInfo[lang].checked)
        .map((lang) => ({
          sampleText: previousTextInfo[lang].sampleText,
          localecode: previousTextInfo[lang].id,
        })) || []
    );
  }

  function getSelectedLocaleCodes() {
    if (!multilanguage) return [];
    const previousTextInfo = JSON.parse(String(multilanguage));
    const localeCodes = Object.keys(previousTextInfo)
      .filter((lang) => previousTextInfo[lang].checked)
      .map((lang) => previousTextInfo[lang].id);
    return localeCodes;
  }

  function getExistingLocaleCode() {
    if (!multilanguage) return [];
    const previousTextInfo = JSON.parse(String(multilanguage));
    const existingLocales = Object.keys(previousTextInfo).map(
      (lang) => previousTextInfo[lang].id
    );
    return existingLocales;
  }

  const itemCount = languages.length;
  const isSameContent = () => {
    return previous === multilanguage && previousDirection === direction;
  };

  return (
    <MultiLangTextContainer style={MultiLangTextContainerStyle()}>
      <MultiLangListContainer
        data-existing-locales={getExistingLocaleCode()}
        data-selected-locales={getSelectedLocaleCodes()}
        data-msg-ddrvarid="data-ddr-msg-list"
        data-direction={direction}
        style={MultiLangListContainerStyle(
          fontSize,
          color,
          multiLineText,
          style
        )}
      >
        {isSameContent() &&
          languages.map(
            (item: { sampleText: any; localecode: string }, index: number) => (
              <MultiLangListItemContainer
                className="not-saved"
                style={MultiLangListTextAnimationStyle(
                  index * 4,
                  itemCount,
                  4,
                  direction
                )}
                key={`mlListItem${item.sampleText}${index}`}
                data-ddrvarid={`${DDRPlaceholderSelector.MultiLangFreeTextMessage}.${item.localecode}`}
              >
                {item.sampleText}
              </MultiLangListItemContainer>
            )
          )}
      </MultiLangListContainer>
    </MultiLangTextContainer>
  );
};
star

Thu Jul 25 2024 15:24:15 GMT+0000 (Coordinated Universal Time) https://github.com/Palak0519/HackerRank-Solutions-1/blob/master/Python/Strings/capitalize.py

@vishwanath_m

star

Thu Jul 25 2024 15:07:56 GMT+0000 (Coordinated Universal Time) https://www.programiz.com/python-programming/online-compiler/

@Ibib

star

Thu Jul 25 2024 15:04:45 GMT+0000 (Coordinated Universal Time) https://www.programiz.com/python-programming/online-compiler/

@Ibib

star

Thu Jul 25 2024 14:34:11 GMT+0000 (Coordinated Universal Time) https://codersdaily.in/courses/hacker-rank-solution/python-string-formatting

@vishwanath_m

star

Thu Jul 25 2024 09:17:56 GMT+0000 (Coordinated Universal Time) https://www.geeksforgeeks.org/problems/root-to-leaf-paths/1?utm_source=youtube&utm_medium=collab_striver_ytdescription&utm_campaign=root-to-leaf-paths

@pratiksh21 #java

star

Thu Jul 25 2024 08:45:04 GMT+0000 (Coordinated Universal Time)

@iamkatmakhafola

star

Thu Jul 25 2024 08:24:02 GMT+0000 (Coordinated Universal Time)

@nishpod

star

Thu Jul 25 2024 07:27:34 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Thu Jul 25 2024 07:21:26 GMT+0000 (Coordinated Universal Time) https://medium.com/

@zemax_c4 ##flutter #go_router

star

Thu Jul 25 2024 07:20:36 GMT+0000 (Coordinated Universal Time) https://medium.com/

@zemax_c4 ##flutter

star

Thu Jul 25 2024 06:07:40 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Thu Jul 25 2024 04:19:44 GMT+0000 (Coordinated Universal Time)

@sosiegoless

star

Thu Jul 25 2024 01:15:02 GMT+0000 (Coordinated Universal Time)

@iamkatmakhafola

star

Thu Jul 25 2024 01:08:51 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Thu Jul 25 2024 00:06:01 GMT+0000 (Coordinated Universal Time)

@WXAPAC

star

Wed Jul 24 2024 22:03:01 GMT+0000 (Coordinated Universal Time)

@wasim_mm1

star

Wed Jul 24 2024 21:08:13 GMT+0000 (Coordinated Universal Time)

@taurenhunter

star

Wed Jul 24 2024 18:35:54 GMT+0000 (Coordinated Universal Time)

@bdusenberry

star

Wed Jul 24 2024 16:30:00 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/8158199/custom-arguments-to-set-in-weblogic-jvm

@ahmadelboghdady

star

Wed Jul 24 2024 15:37:14 GMT+0000 (Coordinated Universal Time)

@pratiksh21 #java

star

Wed Jul 24 2024 14:20:30 GMT+0000 (Coordinated Universal Time) https://www.geeksforgeeks.org/problems/top-view-of-binary-tree/1

@pratiksh21 #java

star

Wed Jul 24 2024 12:04:39 GMT+0000 (Coordinated Universal Time) https://docs.djangoproject.com/en/3.2/_modules/django/contrib/postgres/fields/ranges/

@fearless

star

Wed Jul 24 2024 10:18:27 GMT+0000 (Coordinated Universal Time) https://kontinuum.it/wp-admin/theme-editor.php?file

@webisko

star

Wed Jul 24 2024 09:42:47 GMT+0000 (Coordinated Universal Time) https://gunsbuyerusa.com/product/barwarus-bw-t4-mlok-handguard/

@ak74uforsale

star

Wed Jul 24 2024 08:38:49 GMT+0000 (Coordinated Universal Time)

@pratiksh21 #java

star

Wed Jul 24 2024 08:37:21 GMT+0000 (Coordinated Universal Time) https://leetcode.com/problems/binary-tree-postorder-traversal/description/

@pratiksh21 #java

star

Wed Jul 24 2024 08:35:53 GMT+0000 (Coordinated Universal Time) https://leetcode.com/problems/binary-tree-preorder-traversal/description/

@pratiksh21 #java

star

Wed Jul 24 2024 08:34:51 GMT+0000 (Coordinated Universal Time) https://leetcode.com/problems/binary-tree-inorder-traversal/description/

@pratiksh21 #java

star

Wed Jul 24 2024 07:57:38 GMT+0000 (Coordinated Universal Time)

@kapish #java

star

Wed Jul 24 2024 04:33:20 GMT+0000 (Coordinated Universal Time) https://ssstik.io/en-1

@stonegaming4440

star

Wed Jul 24 2024 02:16:06 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Wed Jul 24 2024 00:13:20 GMT+0000 (Coordinated Universal Time) https://scoop.sh/

@baamn #scoop #terminal

star

Tue Jul 23 2024 22:49:40 GMT+0000 (Coordinated Universal Time) https://superuser.com/questions/1582439/changing-windows-user-folders-3d-objects-desktop-downloads-documents-favori

@baamn #batch #cmd #user

star

Tue Jul 23 2024 22:48:10 GMT+0000 (Coordinated Universal Time) https://superuser.com/questions/1582439/changing-windows-user-folders-3d-objects-desktop-downloads-documents-favori

@baamn

star

Tue Jul 23 2024 21:54:58 GMT+0000 (Coordinated Universal Time)

@iamkatmakhafola

star

Tue Jul 23 2024 21:02:10 GMT+0000 (Coordinated Universal Time)

@Samuel1347 #flutter #dart

star

Tue Jul 23 2024 20:16:06 GMT+0000 (Coordinated Universal Time) https://docs.chocolatey.org/en-us/choco/setup/

@baamn #powershell

star

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

@iamkatmakhafola

star

Tue Jul 23 2024 15:46:36 GMT+0000 (Coordinated Universal Time) https://www.heritagelace.com/

@SMcFarland #gtag- home page

star

Tue Jul 23 2024 15:40:24 GMT+0000 (Coordinated Universal Time)

@knguyencookie #python

star

Tue Jul 23 2024 15:36:40 GMT+0000 (Coordinated Universal Time)

@knguyencookie #python

star

Tue Jul 23 2024 15:34:32 GMT+0000 (Coordinated Universal Time) https://www.thiscodeworks.com/python-loop-through-excel-sheets-place-into-one-df-stack-overflow-python/5ff5c97426c684001453b627

@knguyencookie

star

Tue Jul 23 2024 15:33:20 GMT+0000 (Coordinated Universal Time)

@knguyencookie #python

star

Tue Jul 23 2024 15:31:52 GMT+0000 (Coordinated Universal Time)

@knguyencookie #python

star

Tue Jul 23 2024 15:30:42 GMT+0000 (Coordinated Universal Time)

@knguyencookie #python

star

Tue Jul 23 2024 15:29:42 GMT+0000 (Coordinated Universal Time)

@knguyencookie #python

star

Tue Jul 23 2024 13:46:31 GMT+0000 (Coordinated Universal Time)

@vibeman

star

Tue Jul 23 2024 10:34:12 GMT+0000 (Coordinated Universal Time)

@faizan

star

Tue Jul 23 2024 10:31:01 GMT+0000 (Coordinated Universal Time)

@faizan

Save snippets that work with our extensions

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