Snippets Collections
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>
  );
};
import { CSSProperties } from "styled-components";
import { TextAlign } from "../editor/Text";
import { objectFitOptions } from "../editor/Image";
import { Eases } from "../../../common/constants/AnimationDirection";
import { wrap } from "underscore";

export const TextContainerStyle = (
  fontSize: number,
  alignment?: TextAlign,
  color?: string,
  inStyle?: string,
  multiLineText?: boolean,
  speed?: number,
  fontFamily?: string
): CSSProperties => {
  const adjustTop = 2 * (fontSize * 1.125 - fontSize);
  let style: CSSProperties = {
    fontSize: `${fontSize}px`,
    whiteSpace: "nowrap",
    width: "100%",
    textAlign: `${alignment ?? TextAlign.LEFT}`,
    overflow: "hidden",
    marginTop: `-${adjustTop}px`,
    fontFamily: fontFamily,
  };

  if (multiLineText) {
    style = { ...style, whiteSpace: "break-spaces", height: "100%" };
  }

  if (color) {
    style = { ...style, color: `${color}` };
  }

  if (inStyle) {
    style = { ...style, ...JSON.parse(inStyle) };
  }

  return style;
};

export const StationNameContainerStyle = (): CSSProperties => {
  return {
    width: "100%",
  };
};

export const VideoContainerStyle = (): CSSProperties => {
  return {
    width: "100%",
    height: "100%",
    objectFit: "contain",
  };
};

export const VerticalLineStyle = (
  height: number,
  width: number,
  color: string
): CSSProperties => {
  return {
    borderLeft: `${width}px solid ${color}`,
    height: `${height}px`,
  };
};

export const RectangleStyle = (
  width: number,
  height: number,
  borderColor: string,
  borderWidth: number,
  fillColor: string,
  borderRadius: number
): CSSProperties => {
  return {
    border: `${borderWidth}px solid ${borderColor}`,
    width: `${width}px`,
    height: `${height}px`,
    backgroundColor: `${fillColor}`,
    borderRadius: `${borderRadius}px`,
    backgroundClip: "padding-box",
  };
};

export const ParamContainerStyle = (): CSSProperties => {
  return {
    width: "100%",
    height: "100%",
  };
};

export const MultilineTextContainerStyle = (
  fontSize: number,
  lines: number,
  inStyle?: string,
  color?: string,
  alignment?: TextAlign
): CSSProperties => {
  const adjustTop = 2 * (fontSize * 1.125 - fontSize);
  const adjustHeight = fontSize * lines * 1.125 + 5;
  const adjustLineHeight = fontSize + adjustTop / 2;

  let style: CSSProperties = {
    fontSize: `${fontSize}px`,
    width: "100%",
    textAlign: `${alignment ?? TextAlign.LEFT}`,
    wordWrap: "break-word",
    lineHeight: `${adjustLineHeight}px`,
    height: `${adjustHeight}px`,
    overflow: "hidden",
  };
  if (color) {
    style = { ...style, color: `${color}` };
  }

  if (inStyle) {
    style = { ...style, ...JSON.parse(inStyle) };
  }
  return style;
};

export const checkedMultilineTextContainerStyle = (
  fontSize: number,
  lines: number,
  inStyle?: string,
  color?: string,
  alignment?: TextAlign
): CSSProperties => {
  const adjustTop = 2 * (fontSize * 1.125 - fontSize);
  // const adjustHeight = fontSize * lines * 1.125 + 5; //Commentted for now, need to see impact
  const adjustLineHeight = fontSize + adjustTop / 2;

  let style: CSSProperties = {
    fontSize: `${fontSize}px`,
    width: "100%",
    textAlign: `${alignment ?? TextAlign.LEFT}`,
    wordWrap: "break-word",
    lineHeight: `${adjustLineHeight}px`,
    height: "auto",
    overflow: "hidden",
  };
  if (color) {
    style = { ...style, color: `${color}` };
  }

  if (inStyle) {
    style = { ...style, ...JSON.parse(inStyle) };
  }
  return style;
};

export const EmptyContainerStyle = (isPosition?: boolean): CSSProperties => {
  let style: CSSProperties = {
    width: "100%",
    height: "100%",
    backgroundColor: "transparent",
  };
  if (isPosition) {
    style = { ...style, position: "absolute" };
  }
  return style;
};

export const ImageContainerStyle = (
  objectFit?: objectFitOptions
): CSSProperties => {
  return {
    position: "absolute",
    objectFit: `${objectFit ?? objectFitOptions.CONTAIN}`,
    width: "100%",
    height: "100%",
  };
};

export const HourContainerStyle = (
  alignment?: TextAlign,
  inStyle?: string,
  fontSize?: string
): CSSProperties => {
  let style: CSSProperties = {
    fontSize: `${fontSize}px`,
    fontWeight: "bold",
    color: "rgb(37, 48, 59)",
    textAlign: `${alignment ?? TextAlign.LEFT}`,
  };

  if (inStyle) {
    style = { ...style, ...JSON.parse(inStyle) };
  }
  return style;
};

export const TrainLineContainerStyle = (color: string): CSSProperties => {
  return {
    height: "512px",
    width: "41px",
    backgroundColor: `${color}`,
    overflowY: "hidden",
  };
};

export const TrainLineThreeContainerStyle = (color: string): CSSProperties => {
  return {
    height: "455px",
    width: "41px",
    background: `${color}`,
    overflowY: "hidden",
    borderBottomRightRadius: "30px",
    borderBottomLeftRadius: "30px",
  };
};

export const TrainLineLastContainerStyle = (color: string): CSSProperties => {
  return {
    height: "109px",
    width: "41px",
    background: `${color}`,
    overflowY: "hidden",
    borderBottomRightRadius: "30px",
    borderBottomLeftRadius: "30px",
  };
};

export const TrainLineTwoContainerStyle = (color: string): CSSProperties => {
  return {
    height: "282px",
    width: "41px",
    background: `${color}`,
    overflowY: "hidden",
    borderBottomRightRadius: "30px",
    borderBottomLeftRadius: "30px",
  };
};

export const CircleContainerStyle = (
  width: number,
  height: number,
  borderColor: string,
  borderWidth: number,
  fillColor: string,
  borderRadius: number
): CSSProperties => {
  return {
    border: `${borderWidth}px solid ${borderColor}`,
    width: `${width}px`,
    height: `${height}px`,
    backgroundColor: `${fillColor}`,
    borderRadius: `${borderRadius}%`,
    backgroundClip: "padding-box",
  };
};

export const ConnectionContainerStyle = (
  width: number,
  connImageAlignment: string
): CSSProperties => {
  return {
    width: `${width}px`,
    height: "100%",
    position: "absolute",
    overflow: "hidden",
    display: "flex",
    flexDirection: "row",
    flexWrap: "wrap",
    justifyContent:
      connImageAlignment === "left"
        ? "flex-start"
        : connImageAlignment === "center"
          ? "center"
          : "flex-end",
    alignItems: "center",
  };
};

export const RemovableContentStyle = (
  connectionIconSize: number
): CSSProperties => {
  return {
    width: `${connectionIconSize}px` || "93px",
    height: `${connectionIconSize}px` || "93px",
    display: "flex",
    justifyContent: "center",
    alignItems: "center",
  };
};

export const ConnectionImageContainerStyle = (
  connectionIconSize: number
): CSSProperties => {
  return {
    width: `${connectionIconSize}px` || "100%",
    height: `${connectionIconSize}px` || "100%",
  };
};

export const HorizontalLineContainerStyle = (
  width: number,
  height: number,
  color: string
): CSSProperties => {
  return {
    borderTop: `${height}px solid ${color}`,
    width: `${width}px`,
  };
};

export const ConnTrainMainContainerStyle = (): CSSProperties => {
  return {
    border: "14px solid black",
    width: "100%",
    height: "100%",
    backgroundColor: "white",
  };
};

export const ConnTrainLeftContainerStyle = (): CSSProperties => {
  return {
    position: "relative",
    width: "865px",
    minWidth: "865px",
    maxWidth: "865px",
  };
};

export const ConnTrainRightContainerStyle = (): CSSProperties => {
  return {
    position: "absolute",
    width: "997px",
    top: "0px",
    left: "988px",
  };
};

export const ConnTrainAbsoluteTextSpanContainerStyle = (
  color: string,
  left: number,
  top: number
): CSSProperties => {
  return {
    position: "absolute",
    fontSize: "54px",
    color: `${color}`,
    left: `${left}px`,
    top: `${top}px`,
  };
};

export const ConnTrainPositionedLeftTextContainerStyle = (
  left: number,
  top: number
): CSSProperties => {
  return {
    position: "absolute",
    top: `${top}px`,
    left: `${left}px`,
    whiteSpace: "nowrap",
    display: "flex",
    flexDirection: "row",
  };
};

export const ConnTrainTextSpanContainerStyle = (
  color: string
): CSSProperties => {
  return {
    fontSize: "54px",
    color: `${color}`,
  };
};

export const StationConnectionContainerStyle = (): CSSProperties => {
  return {
    position: "absolute",
    left: "137px",
    top: "43px",
    width: "215px",
  };
};

export const MultiLangTextContainerStyle = (): CSSProperties => {
  return {
    height: "100%",
    overflow: "hidden",
    padding: 0,
    margin: 0,
    fontFamily: "sans-serif",
  };
};

export const MultiLangListContainerStyle = (
  fontSize: number,
  color?: string,
  multiLineText?: boolean,
  inStyle?: string
): CSSProperties => {
  let style: CSSProperties = {
    fontSize: `${fontSize}px`,
    height: "100%",
    position: "relative",
    overflow: "hidden",
    margin: 0,
    padding: 0,
  };

  if (multiLineText) {
    style = { ...style, whiteSpace: "break-spaces", height: "100%" };
  }

  if (color) {
    style = { ...style, color: `${color}` };
  }
  if (inStyle) {
    style = { ...style, ...JSON.parse(inStyle) };
  }
  return style;
};

export const TemperatureContainerStyle = (
  alignment?: TextAlign,
  inStyle?: string
): CSSProperties => {
  let style: CSSProperties = {
    fontSize: "41px",
    fontWeight: "bold",
    color: "rgb(37, 48, 59)",
    textAlign: `${alignment ?? TextAlign.LEFT}`,
  };

  if (inStyle) {
    style = { ...style, ...JSON.parse(inStyle) };
  }
  return style;
};

export const MultiLangListTextAnimationStyle = (
  delay: number,
  itemCount: number,
  speed: number,
  direction: string
): CSSProperties => {
  let style: CSSProperties = {
    position: "absolute",
    paddingLeft: "1rem",
    animation: `ml-list-item-anim-${direction} ${itemCount * speed}s infinite ${Eases.In
      }`,
    animationDelay: `${delay}s`,
  };

  switch (direction) {
    case "right":
      style = { ...style, right: "100%" };
      break;

    case "left":
      style = { ...style, left: "100%" };
      break;

    case "up":
      style = { ...style, top: "-100%" };
      break;

    case "down":
      style = { ...style, top: "100%" };
      break;
  }

  return style;
};

export const AnimatedDrmContainerStyle = (
  width: number,
  height: number,
  color: string
): CSSProperties => {
  return {
    position: "relative",
    width: `${width}px`,
    height: `${height}px`,
    borderTop: `${height}px solid ${color}`,
  };
};

export const AnimatedLineContainerStyle = (
  width: number,
  height: number,
  color: string
): CSSProperties => {
  return {
    position: "relative",
    width: `${width}px`,
    height: `${height}px`,
    borderTop: `${height}px solid ${color}`,
  };
};
Enhance your crypto presence with our professional marketing services. We offer customized strategies to increase your project's visibility and impact.

Our services include social media campaigns, content marketing, influencer collaborations, and PR. We focus on building strong, engaged communities around your project. Our team stays ahead of industry trends to ensure your marketing efforts are effective and relevant. Let us help you navigate the complex crypto landscape and achieve your goals. Reach out to discuss your marketing needs.
$ mkdir projects
$ cd projects
$ rails new ideastore
    create
    create  README.md
    create  Rakefile
...
    remove  config/initializers/cors.rb
    remove  config/initializers/new_framework_defaults_6_0.rb
       run  bundle install
Fetching gem metadata from https://rubygems.org/............
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Using rake 13.0.1
Using concurrent-ruby 1.1.7
...
Fetching webpacker 4.3.0
Installing webpacker 4.3.0
Bundle complete! 17 Gemfile dependencies, 74 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
    run  bundle binstubs bundler
    run  bundle exec spring binstub --all
* bin/rake: Spring inserted
* bin/rails: Spring inserted
      rails  webpacker:install
    create  config/webpacker.yml
Copying webpack core config
    create  config/webpack
    create  config/webpack/development.js
    create  config/webpack/environment.js
    create  config/webpack/production.js
    create  config/webpack/test.js
...
Installing all JavaScript dependencies [4.3.0]
         run  yarn add @rails/webpacker@4.3.0 from "."
yarn add v1.22.4
info No lockfile found.
[1/4] 🔍  Resolving packages...
...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Building fresh packages...
...
├─ webpack-dev-middleware@3.7.2
├─ webpack-dev-server@3.11.0
└─ ws@6.2.1
✨  Done in 19.51s.
Webpacker successfully installed 🎉 🍰
sudo apt-get update

sudo apt-get --only-upgrade install google-chrome-stable.
SELECT Id, PermissionSet.Id, Assignee.Name, PermissionSet.Name
FROM PermissionSetAssignment 
WHERE PermissionSet.PermissionsModifyAllData = true AND PermissionSet.IsOwnedByProfile = false
npm create @bigcommerce/catalyst@latest
 

/**
Checks whether a class exists in an element
*/
function getClass(element, className) {
    return element.className.indexOf(className) !== -1;
  }




//alterntively use
function getClass(element, className) {
    return compareDrawer.className.indexOf("myClass) > -1
  }


// modern use
function hasClass(element, className) {
    return element.classList.contains(className);
}
  
 // returns boolean on all three instances
class Player {
    private int health = 100;

    public void takeDamage(int damage) {
        health -= damage;
        if (health <= 0) {
            die();
        }
    }

    private void die() {
        System.out.println("Player has died.");
        // Additional death logic
    }
}
Example: Score System
java
Copier le code
class Game {
    private int score = 0;

    public void increaseScore(int points) {
        score += points;
        System.out.println("Score: " + score);
    }
}
Example: Power-Ups
java
Copier le code
class PowerUp {
    public void applyTo(Player player) {
        player.increaseSpeed();
    }
}

class Player {
    private int speed = 5;

    public void increaseSpeed() {
        speed += 2;
    }

    public void pickUpPowerUp(PowerUp powerUp) {
        powerUp.applyTo(this);
    }
}
Example: Collectibles
java
Copier le code
class Player {
    private List<Item> inventory = new ArrayList<>();
    private int score = 0;

    public void collect(Item item) {
        inventory.add(item);
        score += item.getPoints();
    }
}

class Item {
    private int points;

    public int getPoints() {
        return points;
    }
}
Example: Level System
java
Copier le code
class Game {
    private List<Level> levels;
    private Level currentLevel;

    public void loadLevel(int levelNumber) {
        currentLevel = levels.get(levelNumber);
    }
}
Example: Particle Effects
java
Copier le code
class Game {
    private List<Particle> particles = new ArrayList<>();

    public void createExplosion(int x, int y) {
        particles.add(new Explosion(x, y));
    }
}

class Particle {
    // Particle implementation
}

class Explosion extends Particle {
    public Explosion(int x, int y) {
        // Explosion effect implementation
    }
}
Example: Sound Effects
java
Copier le code
class SoundManager {
    public static void playSound(String soundFile) {
        // Play sound implementation
    }
}
Example: Background Music
java
Copier le code
class MusicManager {
    public static void playBackgroundMusic(String musicFile) {
        // Play background music implementation
    }
}
Example: Saving/Loading
java
Copier le code
class SaveManager {
    public void save(GameState gameState, String saveFile) {
        // Save game state implementation
    }

    public GameState load(String saveFile) {
        // Load game state implementation
        return new GameState();
    }
}

class GameState {
    // Game state implementation
}
Example: Multiplayer
java
Copier le code
class Game {
    private List<Player> players = new ArrayList<>();

    public void addPlayer(Player player) {
        players.add(player);
    }
}
Example: Inventory System
java
Copier le code
class Player {
    private List<Item> inventory = new ArrayList<>();

    public void addItemToInventory(Item item) {
        inventory.add(item);
    }
}
Example: Dialog System
java
Copier le code
class DialogBox {
    public void show(String text) {
        // Display dialog implementation
    }
}
Example: Pathfinding
java
Copier le code
class PathFinder {
    public List<Point> find(int startX, int startY, int targetX, int targetY) {
        // Pathfinding algorithm implementation
        return new ArrayList<>();
    }
}
Example: Animations
java
Copier le code
class AnimatedSprite {
    private int currentFrame = 0;
    private Image[] animationFrames;

    public void animate() {
        currentFrame = (currentFrame + 1) % animationFrames.length;
    }
}
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class Game extends JPanel implements Runnable, KeyListener {
    private boolean running = true;
    private Player player;
    private Enemy enemy;
    private Thread gameThread;

    public Game() {
        player = new Player();
        enemy = new Enemy();
        this.addKeyListener(this);
        this.setFocusable(true);
        this.setFocusTraversalKeysEnabled(false);
        gameThread = new Thread(this);
        gameThread.start();
    }

    @Override
    public void run() {
        while (running) {
            update();
            repaint();
            try {
                Thread.sleep(16); // roughly 60 FPS
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }

    private void update() {
        player.update();
        enemy.update();
    }

    @Override
    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        player.render(g);
        enemy.render(g);
    }

    @Override
    public void keyPressed(KeyEvent e) {
        player.keyPressed(e);
    }

    @Override
    public void keyReleased(KeyEvent e) {
        player.keyReleased(e);
    }

    @Override
    public void keyTyped(KeyEvent e) {}

    public static void main(String[] args) {
        JFrame frame = new JFrame("2D Game");
        Game game = new Game();
        frame.add(game);
        frame.setSize(800, 600);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
    }
}

class Player {
    private int x, y, velocityY;
    private boolean onGround = true, movingLeft = false, movingRight = false, jumping = false;
    private final int speed = 5, jumpStrength = 10, gravity = 1;

    public void update() {
        if (movingLeft) x -= speed;
        if (movingRight) x += speed;
        if (jumping && onGround) {
            velocityY = -jumpStrength;
            onGround = false;
        }
        y += velocityY;
        if (y >= 500) { // Assuming ground level is at y = 500
            y = 500;
            onGround = true;
            velocityY = 0;
        } else {
            velocityY += gravity;
        }
    }

    public void render(Graphics g) {
        g.fillRect(x, y, 50, 50); // Draw player as a rectangle
    }

    public void keyPressed(KeyEvent e) {
        int key = e.getKeyCode();
        if (key == KeyEvent.VK_LEFT) movingLeft = true;
        if (key == KeyEvent.VK_RIGHT) movingRight = true;
        if (key == KeyEvent.VK_SPACE) jumping = true;
    }

    public void keyReleased(KeyEvent e) {
        int key = e.getKeyCode();
        if (key == KeyEvent.VK_LEFT) movingLeft = false;
        if (key == KeyEvent.VK_RIGHT) movingRight = false;
        if (key == KeyEvent.VK_SPACE) jumping = false;
    }
}

class Enemy {
    private int x, y;

    public void update() {
        // Enemy AI logic
    }

    public void render(Graphics g) {
        g.fillRect(x, y, 50, 50); // Draw enemy as a rectangle
    }
}
INPUT_FILE=$(gsutil ls "gs://atarg-data-dev-smp-extract/atarg_customer_exports/vici_dnbipr_testing/20240601/" | tail -1)
echo $INPUT_FILE
if [[ $INPUT_FILE == gs://* ]]; then
  echo "Compressed File exists"
else
  echo "Compressed file does not exist"
  exit 1
fi
gsutil -q stat gs://atarg-data-dev-smp-extract/atarg_customer_exports/vici_dnbipr_testing_output20/jobid

status=$?
echo $status


if [[ $status != 0 ]]
then
    # clean up anything already in output
    # echo $(gsutil -m rm -r -f {output} 2>&1)
    # python nparts.py --input_prefix gs://atarg-data-dev-smp-extract/atarg_customer_exports2222/vici_dnbipr_testing/20240601/data.000000000000.csv.gz --output_prefix gs://atarg-data-dev-smp-extract/atarg_customer_exports/vici_dnbipr_testing_output20/20240601/ \
    # --region us-central1 --project atarg-data-dev --runner DataflowRunner --job_name testpasrtwswe --temp_location gs://atarg-data-dev-smp-extract/dataflow/tmp31/ &
    tmp_file=$(mktemp) || echo Running  > $tmp_file
    gsutil cp $tmp_file  gs://atarg-data-dev-smp-extract/atarg_customer_exports/vici_dnbipr_testing_output20/jobid || rm "$tmp_file"
    echo submitted job
    # exit 1 means, we'll retry and check status of job
    exit 1
fi

state=$(gcloud dataflow jobs list | grep testpasrtwswe | head -1 | awk '{print $(NF-1)}')
echo $state
echo job state: $state

if [[ $state == "Failed" ]]
then
    gsutil -m rm -r -f gs://atarg-data-dev-smp-extract/atarg_customer_exports/vici_dnbipr_testing_output20/jobid
    exit 1
fi

if [[ $state == "Done" ]]
then
    tmp_file=$(mktemp) || echo "Done"  > $tmp_file
    gsutil cp $tmp_file  gs://atarg-data-dev-smp-extract/atarg_customer_exports/vici_dnbipr_testing_output20/jobid || rm "$tmp_file"
fi
/**
*@description        :This methode useful for to assign permission set group to the user
*@author             : Gopi
*@group              : 
*@created on         : 
*@last modified on   :
*@last modified by   : 
*@modification log   : 
**/ 
@future
    public static void assignPermissionSetGroupToUser(Id userId) {
        try{
            PermissionSetGroup psGroup = [SELECT Id FROM PermissionSetGroup WHERE DeveloperName = 'PortalAuth_User_Permission_Set_Group' LIMIT 1];
            
            if (psGroup != null) {
                system.debug('psGroup==>'+psGroup);
                system.debug('userId==>'+userId);
                PermissionSetAssignment psAssignment = new PermissionSetAssignment();
                psAssignment.AssigneeId = userId;
                psAssignment.PermissionSetGroupId = psGroup.Id;
                insert psAssignment;
                System.debug('Permission Set Group Assignment: ' + psAssignment);
            } else {
                System.debug('Permission Set Group not found.');
                
            }
        }catch(Exception a){
            CustomException__c ex=new CustomException__c();
            ex.ClassName__c='AccountContactCreationController';
            ex.CreatedById = UserInfo.getUserId();
            //ex.Name = 'Exception Name'; 
            ex.Exception_Message__c = a.getMessage();
            ex.Exception_Type__c = a.getTypeName();
            //ex.Govt_Limit_in_Executing_Code__c = a.getGovtLimit();
            ex.LastModifiedById = UserInfo.getUserId();
            ex.Line_Number__c = a.getLineNumber(); 
            ex.MethodName__c = 'assignPermissionSetGroupToUser'; 
            ex.OwnerId = UserInfo.getUserId();
            // ex.Related_To_Number__c = '12345'; 
            ex.StackTrace__c = a.getStackTraceString();
            
            
            insert ex;
        }
    }
//OrderService
import { HttpHeaders, HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { CartItemViewModel, CartViewModel, Product, WishlistItemViewModel, WishlistViewModel } from '../shared/order';
import { BehaviorSubject, map, Observable } from 'rxjs';

@Injectable({
  providedIn: 'root'
})
export class OrderService {
  private cartItemsCountSource = new BehaviorSubject<number>(0);
  cartItemsCount = this.cartItemsCountSource.asObservable();

  private wishlistItemsCountSource = new BehaviorSubject<number>(0);
  wishlistItemsCount = this.wishlistItemsCountSource.asObservable();
  
  httpOptions = {
    headers: new HttpHeaders({
      'Content-Type': 'application/json'
    })
  };
  
  constructor(private http: HttpClient) {}
  apiUrl: string = "https://localhost:7185/api/Order";

  //navbar count
  updateCartCount(count: number) {
    this.cartItemsCountSource.next(count);
  }

  loadCartItems(): void {
    this.getCartItems().subscribe({
      next: (items) => {
        const totalCount = items.reduce((sum, item) => sum + item.quantity, 0);
        this.updateCartCount(totalCount);
      },
      error: (err) => {
        console.error('Error loading cart items', err);
      }
    });
  }

  updateWishlistCount(count: number) {
    this.wishlistItemsCountSource.next(count);
  }

  loadWishlistItems(): void {
    this.getWishlistItems().subscribe({
      next: (items) => {
        this.updateWishlistCount(items.length);
      },
      error: (err) => {
        console.error('Error loading wishlist items', err);
      }
    });
  }

  //products
  getAllProducts(): Observable<Product[]> {
    return this.http.get<Product[]>(`${this.apiUrl}/GetAllProducts`, this.httpOptions);
  }

  getProductById(product_id: number): Observable<Product> {
    return this.http.get<Product>(`${this.apiUrl}/GetProductById/${product_id}`, this.httpOptions);
  }

  //cart
  getCartItems(): Observable<CartItemViewModel[]> {
    const token = localStorage.getItem('token');
    console.log('Retrieved token from localStorage:', token); 

    const httpOptionsWithAuth = {
      headers: new HttpHeaders({
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${token}`
      })
    };

    return this.http.get<CartItemViewModel[]>(`${this.apiUrl}/GetCart`, httpOptionsWithAuth);
  }

  addToCart(cartViewModel: { product_ID: number; quantity: number; size: string }): Observable<any> {
    const token = localStorage.getItem('token');
    console.log('Retrieved token from localStorage:', token); 

    const httpOptionsWithAuth = {
      headers: new HttpHeaders({
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${token}`
      })
    };

    return this.http.post<any>(`${this.apiUrl}/AddToCart`, cartViewModel, httpOptionsWithAuth);
  }

  updateCart(cartViewModel: CartViewModel): Observable<any> {
    const token = localStorage.getItem('token');
    console.log('Retrieved token from localStorage:', token); 

    const httpOptionsWithAuth = {
      headers: new HttpHeaders({
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${token}`
      })
    };

    return this.http.put<any>(`${this.apiUrl}/UpdateCart`, cartViewModel, httpOptionsWithAuth);
  }

  removeFromCart(productId: number): Observable<any> {
    const token = localStorage.getItem('token');
    const httpOptionsWithAuth = {
      headers: new HttpHeaders({
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${token}`
      })
    };
    return this.http.delete<any>(`${this.apiUrl}/RemoveFromCart/${productId}`, httpOptionsWithAuth);
  }

  //wishlist
  getWishlistItems(): Observable<WishlistItemViewModel[]> {
    const token = localStorage.getItem('token');
    const httpOptionsWithAuth = {
      headers: new HttpHeaders({
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${token}`
      })
    };
    return this.http.get<WishlistItemViewModel[]>(`${this.apiUrl}/GetWishlist`, httpOptionsWithAuth);
  }

  addToWishlist(wishlistViewModel: WishlistViewModel): Observable<any> {
    const token = localStorage.getItem('token');
    const httpOptionsWithAuth = {
      headers: new HttpHeaders({
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${token}`
      })
    };
    return this.http.post<any>(`${this.apiUrl}/AddToWishlist`, wishlistViewModel, httpOptionsWithAuth);
  }

  removeFromWishlist(productId: number): Observable<any> {
    const token = localStorage.getItem('token');
    const httpOptionsWithAuth = {
      headers: new HttpHeaders({
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${token}`
      })
    };
    return this.http.delete<any>(`${this.apiUrl}/RemoveFromWishlist/${productId}`, httpOptionsWithAuth);
  }

  moveFromWishlistToCart(product_ID: number): Observable<any> {
    const token = localStorage.getItem('token');
    const httpOptionsWithAuth = {
      headers: new HttpHeaders({
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${token}`
      }),
      responseType: 'text' as 'json' // Specify response type as text
    };
    return this.http.post<any>(`${this.apiUrl}/MoveFromWishlistToCart`, { product_ID, quantity: 1 }, httpOptionsWithAuth);
  }

  //payfast
  getTotalAmount(): Observable<number> {
    return this.getCartItems().pipe(
      map(items => items.reduce((sum, item) => sum + (item.unit_Price * item.quantity), 0))
    );
  }

  getUserData(): any {
    // Replace this with your actual implementation to get user data
    return {
      email: 'user@example.com'
    };
  }
}
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

star

Tue Jul 23 2024 10:30:38 GMT+0000 (Coordinated Universal Time)

@faizan

star

Tue Jul 23 2024 10:10:48 GMT+0000 (Coordinated Universal Time) https://www.blockchainappfactory.com/crypto-marketing-agency

@auroragrace #cryptoexchange #cryptoexchangedevelopment

star

Tue Jul 23 2024 10:01:20 GMT+0000 (Coordinated Universal Time) https://dhanusir.com/ruby-on-rails/section-three/app-idea-model

@dhanusir #ruby #rubyonrails

star

Tue Jul 23 2024 09:50:47 GMT+0000 (Coordinated Universal Time) https://askubuntu.com/questions/1275967/how-to-update-chrome-in-ubuntu-20-04

@hamzaaeel

star

Tue Jul 23 2024 09:16:17 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it

@affank1020 #cs

star

Tue Jul 23 2024 07:29:05 GMT+0000 (Coordinated Universal Time) https://www.salesforceben.com/crucial-salesforce-permissions-you-should-not-assign-to-users/

@WayneChung

star

Tue Jul 23 2024 06:40:32 GMT+0000 (Coordinated Universal Time) https://www.npmjs.com/package/@bigcommerce/create-catalyst

@ioVista

star

Tue Jul 23 2024 06:40:25 GMT+0000 (Coordinated Universal Time) https://www.npmjs.com/package/@bigcommerce/create-catalyst

@ioVista

star

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

@davidmchale #function #indexof #classname

star

Tue Jul 23 2024 05:28:02 GMT+0000 (Coordinated Universal Time) https://chatgpt.com/

@chachou #java

star

Tue Jul 23 2024 05:20:59 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/623451/how-can-i-make-my-own-event-in-c

@javicinhio

star

Tue Jul 23 2024 05:20:28 GMT+0000 (Coordinated Universal Time) https://csharpindepth.com/Articles/Events

@javicinhio

star

Tue Jul 23 2024 05:20:06 GMT+0000 (Coordinated Universal Time) https://www.geeksforgeeks.org/garbage-collection-in-c-sharp-dot-net-framework/

@javicinhio

star

Tue Jul 23 2024 05:19:34 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/12667304/remove-all-controls-in-a-flowlayoutpanel-in-c-sharp

@javicinhio

star

Tue Jul 23 2024 05:19:22 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/4257372/how-to-force-garbage-collector-to-run

@javicinhio

star

Tue Jul 23 2024 05:14:19 GMT+0000 (Coordinated Universal Time) https://chatgpt.com/

@chachou

star

Tue Jul 23 2024 05:11:34 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/12667304/remove-all-controls-in-a-flowlayoutpanel-in-c-sharp

@javicinhio

star

Tue Jul 23 2024 04:50:08 GMT+0000 (Coordinated Universal Time)

@singhsg

star

Tue Jul 23 2024 04:27:51 GMT+0000 (Coordinated Universal Time)

@562458 ##soql

star

Tue Jul 23 2024 04:00:19 GMT+0000 (Coordinated Universal Time) https://boypedia.xyz/

@boypedia

star

Mon Jul 22 2024 22:35:04 GMT+0000 (Coordinated Universal Time)

@iamkatmakhafola

star

Mon Jul 22 2024 20:37:43 GMT+0000 (Coordinated Universal Time) https://clean-code.io/about

@Saeed_Ahmed #undefined

Save snippets that work with our extensions

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