Snippets Collections
https://picsum.photos/id/1/200/300
https://picsum.photos/id/237/200/300
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));


// Register the OrderStatusUpdater hosted service
builder.Services.AddHostedService<OrderStatusUpdater>();
builder.Services.AddHostedService<UserDeletionService>();


// 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();
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\
camera_usb_options="-r 640x480 -f 10 -y"
export LD_LIBRARY_PATH=.
./mjpg_streamer -o "output_http.so -w ./www" -i "input_raspicam.so"
cd mjpg-streamer-experimental
mkdir _build
cd _build
cmake -DENABLE_HTTP_MANAGEMENT=ON ..
make
sudo make install
cd mjpg-streamer-experimental
make distclean
make CMAKE_BUILD_TYPE=Debug
sudo make install
//UserDeletionService.cs
using av_motion_api.Data; // Adjust the namespace to match your project
using av_motion_api.Models;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;

namespace av_motion_api.Services
{
    public class UserDeletionService : IHostedService, IDisposable
    {
        private readonly IServiceProvider _serviceProvider;
        private Timer _timer;

        public UserDeletionService(IServiceProvider serviceProvider)
        {
            _serviceProvider = serviceProvider;
        }

        public Task StartAsync(CancellationToken cancellationToken)
        {
            _timer = new Timer(DeleteDeactivatedUsers, null, TimeSpan.Zero, TimeSpan.FromMinutes(0));
            return Task.CompletedTask;
        }

        private void DeleteDeactivatedUsers(object state)
        {
            using (var scope = _serviceProvider.CreateScope())
            {
                var context = scope.ServiceProvider.GetRequiredService<AppDbContext>();
                var userManager = scope.ServiceProvider.GetRequiredService<UserManager<User>>();

                var sixMonthsAgo = DateTime.UtcNow.AddMonths(-6);

                var usersToDelete = context.Users
                    .Where(u => u.User_Status_ID == 2 && u.DeactivatedAt < sixMonthsAgo)
                    .ToList();

                foreach (var user in usersToDelete)
                {
                    userManager.DeleteAsync(user).Wait();
                }

                context.SaveChanges();
            }
        }

        public Task StopAsync(CancellationToken cancellationToken)
        {
            _timer?.Change(Timeout.Infinite, 0);
            return Task.CompletedTask;
        }

        public void Dispose()
        {
            _timer?.Dispose();
        }
    }
}
//program.cs
builder.Services.AddHostedService<OrderStatusUpdater>();
M140 S60 ; starting by heating the bed for nominal mesh accuracy
M117 Homing all axes ; send message to printer display
G28      ; home all axes
M420 S0  ; Turning off bed leveling while probing, if firmware is set
         ; to restore after G28
M117 Heating the bed ; send message to printer display
M190 S60 ; waiting until the bed is fully warmed up
M300 S1000 P500 ; chirp to indicate bed mesh levels is initializing
M117 Creating the bed mesh levels ; send message to printer display
M155 S30 ; reduce temperature reporting rate to reduce output pollution
@BEDLEVELVISUALIZER	; tell the plugin to watch for reported mesh
G29 T	   ; run bilinear probing
M155 S3  ; reset temperature reporting
M140 S0 ; cooling down the bed
M500 ; store mesh in EEPROM
M300 S440 P200 ; make calibration completed tones
M300 S660 P250
M300 S880 P300
M117 Bed mesh levels completed ; send message to printer display
camera_usb_options="-r 640x480 -f 10 -y"
// Iterate over the fields in the TempLINK table
FOR i = 0 TO NoOfFields('LINK')
    LET Field = FieldName(i, 'LINK');
    TRACE $(Field);
NEXT i
add_filter( 'sps_placeholder_image_upload', '__return_false' );
app.post('/send-otp', async (req, res) => {
  const { phoneNumber } = req.body;

  const apiKey = '3mW3hfluK8dpayQ53NXKdBhophrKP9sD8GKPi8qKqsMTZAAEsyq8HGMZCeSv';
  const otp = Math.floor(100000 + Math.random() * 900000); // Generate a 6-digit OTP
  const message = `${otp}`;

  const data = {
      sender_id: 'TKSOLV',
      message: '110131',
      variables_values: message,
      route: 'dlt',
      numbers: phoneNumber,
  };

  const options = {
      method: 'POST',
      headers: {
          'authorization': apiKey,
          'Content-Type': 'application/json'
      },
      data: JSON.stringify(data),
      url: 'https://www.fast2sms.com/dev/bulkV2',
  };

  try {
      const response = await axios(options);
      res.status(200).send({ success: true, message: 'OTP sent successfully', otp: otp });
  } catch (error) {
      res.status(500).send({ success: false, message: 'Failed to send OTP', error: error.message });
  }
});

// Try this simple way

const today = new Date();
let date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
console.log(date);
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":sparkles: Boost Days - Whats On This Week! :sparkles:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Mōrena Ahuriri & happy Monday! :smiling-hand-over-mouth:\n\nWe're excited to bring you another great week in the office with our Boost Day Program! :yay: Please see below for whats on this week :arrow-bounce:"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-27: Wednesday, 27th November",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Café Partnership*: Enjoy coffee and café-style beverages from our cafe partner, *Adoro*, located in our office building *8:00AM - 11:30AM*.\n:sandwich: *Lunch*: Provided by *Mitzi and Twinn* *12:00PM - 1:00PM* in the Kitchen. \n:xero: *Global All Hands*: Streaming in Clearview *11:00AM - 12:00PM*."
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-28: Thursday, 28th November",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":coffee: *Café Partnership*: Enjoy coffee and café-style beverages from our cafe partner, *Adoro*, located in our office building *8:00AM - 11:30AM*. \n:breakfast: *Breakfast*: Provided by *Roam* *9:30AM - 11:00AM* in the Kitchen. \n:books: *Book Club*: HB Bibliophiles monthly meet up in Te Mata, *12:30PM - 1:30PM*. Join the slack channel to stay up to date with book chats in #hb_bibliophiles"
			}
		},
		{
			"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=eGVyby5jb21fbXRhc2ZucThjaTl1b3BpY284dXN0OWlhdDRAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ|*Hawkes Bay Social Calendar*>, and get ready to Boost your workdays!\n\nWX Team :party-wx:"
			}
		}
	]
}
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":star: Introducing Xero Boost Days! :star:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Brisbane! \n\nWe're excited to announce the launch of our Boost Day Program!\n\nStarting This week, as part of our <https://xpresso.xero.com/blog/featured/more-opportunities-to-come-together-with-xeros-connect/|*Xeros Connect Strategy*>, you'll experience supercharged days at the office every *Wednesday*. Get ready for a blend of delicious food, beverages, wellness activites, and fun connections!\n\nPlease see below for what's on this week! "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-31: Wednesday,31st July",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:Lunch: *Lunch*: Provided by *Zeus Street Greek* from *12pm* in our suite."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*LATER THIS MONTH:*"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*Wednesday, 21nd 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=Y19jYzU3YWJkZTE4ZTE0YzVlYTYxMGU4OThjZjRhYWQ0MTNhYmIzMDBjZjBkMzVlNDg0M2M5NDQ4NDk3NDAyYjkyQGdyb3VwLmNhbGVuZGFyLmdvb2dsZS5jb20|*Canberra Social Calendar*>, and get ready to Boost your workdays!\n\nLove,\nWX Team :party-wx:"
			}
		}
	]
}
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":star: Introducing Xero Boost Days! :star:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Brisbane! \n\nWe're excited to announce the launch of our Boost Day Program!\n\nStarting next week, as part of our <https://xpresso.xero.com/blog/featured/more-opportunities-to-come-together-with-xeros-connect/|*Xeros Connect Strategy*>, you'll experience supercharged days at the office every *Monday* and *Wednesday*. Get ready for a blend of delicious food, 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-29: Monday, 29th July",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Café Partnership*: Enjoy free coffee and café-style beverages from our Cafe partner *Edwards*.\n:Lunch: *Lunch*: Provided by *DannyBoys Rockstar Sandwiches* from *12pm* in the kitchen.\n:massage:*Wellbeing*: Pilates at *SP Brisbane City* is bookable every Monday! Watch this channel on how to book."
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-31: Wednesday,31st July",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":coffee: *Café Partnership*: Enjoy free coffee and café-style beverages from our Cafe partner *Edwards*.\n:late-cake: *Morning Tea*: Provided by *Say Cheese* from *10am* in the kitchen."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*LATER THIS MONTH:*"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*Wednesday, 21nd 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=Y19uY2M4cDN1NDRsdTdhczE0MDhvYjZhNnRjb0Bncm91cC5jYWxlbmRhci5nb29nbGUuY29t|*Brisbane Social Calendar*>, and get ready to Boost your workdays!\n\nLove,\nWX Team :party-wx:"
			}
		}
	]
}
<div class="steps active" id="content1">
</div>

<div class="steps" id="content2">
</div>

<div class="steps" id="content3">
</div>


<!-- NEXT PREV BUTTON LOGIC -->
<div class="form-row row">
    <div class="col-6">
        <div class="text-start">
            <a id="prev" class="btn btn-lg btn-dark">Previous</a>
        </div>
    </div>
    <div class="col-6">
        <div class="text-end">
            <a id="next" class="btn btn-lg btn-dark">Next</a>
            <button id="lastSubmit" type="submit" class="btn btn-lg btn-primary">Submit</button>
        </div>
    </div>
</div>
<!-- NEXT PREV BUTTON LOGIC -->



<style>
    .steps { display: none; }
    .steps.active { display: block; }
    button { display: inline-block; margin: 5px; }
</style>


<script>
	//NEXT AND PREVIOUS CONDITION;
	$(document).ready(function(){
	    var currentIndex = 0;
	    var contents = $('.steps');
	    var contentCount = contents.length;

	    function updateButtons() {
	        $('#prev').toggle(currentIndex > 0);
	        $('#next').toggle(currentIndex < contentCount - 1);
	        $('#lastSubmit').toggle(currentIndex === contentCount - 1);
	    }

	    $('#next').click(function(){
	        if (currentIndex < contentCount - 1) {
	            $(contents[currentIndex]).removeClass('active');
	            currentIndex++;
	            $(contents[currentIndex]).addClass('active');
	            updateButtons();
	        }
	    });

	    $('#prev').click(function(){
	        if (currentIndex > 0) {
	            $(contents[currentIndex]).removeClass('active');
	            currentIndex--;
	            $(contents[currentIndex]).addClass('active');
	            updateButtons();
	        }
	    });

	    updateButtons();
	});
</script>
# Simple output (with Unicode)
>>> print("Hello, I'm Python!")
Hello, I'm Python!
# Input, assignment
>>> name = input('What is your name?\n')
What is your name?
Python
>>> print(f'Hi, {name}.')
Hi, Python.
def merge_the_tools(string, k):
    while string: # while string is not None
        seen = ''
        s = string[0:k]
        for c in s:
            if c not in seen:
                seen += c
        print(seen)
        string = string[k:]
        
if __name__ == '__main__':
    string, k = input(), int(input())
    merge_the_tools(string, k)
def minion_game(string):
    vowels = 'AEIOU'
    k,s = 0,0
    l =len(string)
    for i in range(l):
        if string[i] in vowels:
            k += (l-i)
        else:
            s += (l-i)
    if k > s:
        print("Kevin", k)
    elif k < s:
        print("Stuart", s)
    else:
        print("Draw")

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            return Ok(products);
        }

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

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

            };



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

            return Ok(newProduct);
        }


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

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

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

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

            return NoContent();
        }

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

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

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

            return NoContent();
        }

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

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

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

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

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

SETLOCAL

@REM --- Start Functions ---

GOTO :ENDFUNCTIONS

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

        echo Derby server stopped.
    )

    set ALREADY_STOPPED=true
GOTO :EOF

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

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


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

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

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


@REM Call setDomainEnv here.

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

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

set SAVE_JAVA_OPTIONS=%JAVA_OPTIONS%

set SAVE_CLASSPATH=%CLASSPATH%

set TMP_UPDATE_SCRIPT=%TMP%\update.cmd


@REM Start Derby

set DERBY_DEBUG_LEVEL=0

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

)

set JAVA_OPTIONS=%SAVE_JAVA_OPTIONS%

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

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

set SAVE_JAVA_OPTIONS=

set CLASSPATH=%SAVE_CLASSPATH%

set SAVE_CLASSPATH=

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

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

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

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

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

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

echo .

echo .

echo JAVA Memory arguments: %MEM_ARGS%

echo .

echo CLASSPATH=%CLASSPATH%

echo .

echo PATH=%PATH%

echo .

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

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

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

echo *  server administration, use the WebLogic Server *

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

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

@REM START WEBLOGIC

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

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

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

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


CALL :stopAll

popd

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


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

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

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

    call "%SCRIPTPATH%\startWebLogic.cmd"

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

        call "%SCRIPTPATH%\startWebLogic.cmd"

    )
)

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

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



ENDLOCAL

// } Driver Code Ends


//User function Template for Java


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

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

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

from .utils import AttributeSetter

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



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

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




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




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

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

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

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

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

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

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

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

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

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




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

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




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

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




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

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




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

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




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

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



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


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

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

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


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


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

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

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

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


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


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


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


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


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


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


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

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


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

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


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


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


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


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


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

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

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

Fri Jul 26 2024 10:00:31 GMT+0000 (Coordinated Universal Time) https://picsum.photos/images

@febyputra17

star

Fri Jul 26 2024 09:59:57 GMT+0000 (Coordinated Universal Time) https://picsum.photos/

@febyputra17

star

Fri Jul 26 2024 08:39:34 GMT+0000 (Coordinated Universal Time)

@iamkatmakhafola

star

Fri Jul 26 2024 08:25:52 GMT+0000 (Coordinated Universal Time) https://superuser.com/questions/973153/standard-value-of-path-variable-windows-10

@baamn

star

Fri Jul 26 2024 07:31:25 GMT+0000 (Coordinated Universal Time) http://octoprint.local/webcam/?action

@amccall23

star

Fri Jul 26 2024 07:20:11 GMT+0000 (Coordinated Universal Time) https://github.com/jacksonliam/mjpg-streamer

@amccall23

star

Fri Jul 26 2024 07:20:04 GMT+0000 (Coordinated Universal Time) https://github.com/jacksonliam/mjpg-streamer

@amccall23

star

Fri Jul 26 2024 07:20:02 GMT+0000 (Coordinated Universal Time) https://github.com/jacksonliam/mjpg-streamer

@amccall23

star

Fri Jul 26 2024 07:19:58 GMT+0000 (Coordinated Universal Time) https://github.com/jacksonliam/mjpg-streamer

@amccall23

star

Fri Jul 26 2024 07:19:49 GMT+0000 (Coordinated Universal Time) https://github.com/jacksonliam/mjpg-streamer

@amccall23

star

Fri Jul 26 2024 07:19:46 GMT+0000 (Coordinated Universal Time) https://github.com/jacksonliam/mjpg-streamer

@amccall23

star

Fri Jul 26 2024 07:19:43 GMT+0000 (Coordinated Universal Time) https://github.com/jacksonliam/mjpg-streamer

@amccall23

star

Fri Jul 26 2024 07:19:06 GMT+0000 (Coordinated Universal Time)

@iamkatmakhafola

star

Fri Jul 26 2024 06:53:29 GMT+0000 (Coordinated Universal Time) https://github.com/jneilliii/OctoPrint-BedLevelVisualizer/blob/master/wiki/gcode-examples.md

@amccall23

star

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

@amccall23

star

Fri Jul 26 2024 06:34:54 GMT+0000 (Coordinated Universal Time) https://htm-rapportage.eu.qlikcloud.com/dataloadeditor/app/7cead63c-b08c-4c31-831d-fb32b17f8310/hubUrl//catalog

@bogeyboogaard

star

Fri Jul 26 2024 05:36:37 GMT+0000 (Coordinated Universal Time) https://secure.helpscout.net/conversation/2659578769/28353?viewId

@Pulak

star

Fri Jul 26 2024 05:26:16 GMT+0000 (Coordinated Universal Time)

@codeing #javascript

star

Fri Jul 26 2024 04:57:21 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/1531093/how-do-i-get-the-current-date-in-javascript/28434935

@mchemlal #javascript

star

Fri Jul 26 2024 03:56:26 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Fri Jul 26 2024 00:59:00 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Fri Jul 26 2024 00:53:35 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Fri Jul 26 2024 00:33:10 GMT+0000 (Coordinated Universal Time)

@wasim_mm1

star

Thu Jul 25 2024 21:24:14 GMT+0000 (Coordinated Universal Time) https://www.python.org/

@Black_Shadow

star

Thu Jul 25 2024 15:51:36 GMT+0000 (Coordinated Universal Time) https://medium.com/jen-li-chen-in-data-science/merge-the-tools-4ec999c75bc9

@vishwanath_m

star

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

@vishwanath_m

star

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

@Ibib

star

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

@Ibib

star

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

@vishwanath_m

star

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

@pratiksh21 #java

star

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

@iamkatmakhafola

star

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

@nishpod

star

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

@FOHWellington

star

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

@zemax_c4 ##flutter #go_router

star

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

@zemax_c4 ##flutter

star

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

@FOHWellington

star

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

@sosiegoless

star

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

@iamkatmakhafola

star

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

@FOHWellington

star

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

@WXAPAC

star

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

@wasim_mm1

star

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

@taurenhunter

star

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

@bdusenberry

star

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

@ahmadelboghdady

star

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

@pratiksh21 #java

star

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

@pratiksh21 #java

star

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

@fearless

star

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

@webisko

star

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

@ak74uforsale

star

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

@pratiksh21 #java

Save snippets that work with our extensions

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