Snippets Collections
bool isValidParenthesis (string expression) {
  stack<char> s;
  for (int i = 0; i < expression.length(); i++) {
    char ch = expression[i];
    // if opening bracket push it to stack
    // if closing bracket, pop from stack, check if the popped element is the                 matching opening bracket
    if (ch == '(' || ch =='{' || ch == '[') {
      s.push(ch);
    }
    else {
      // for closing bracket
      if (!s.empty()) {
        char top = s.top();
        if ((ch == ')' && top == '(') || (ch == '}' && top == '{') || (ch == ']' &&               top == '[')) {
          s.pop();
        }
      }
      else {
        return false;
      }
    }
  }
  if (s.empty()) {
    return true;
  }
  else {
    return false;
  }
}
// App.tsx
import React, { useState } from 'react';
import './App.css';

function App() {
  const [top, setTop] = useState(0);
  const [left, setLeft] = useState(0);
  const [backgroundColor, setBackgroundColor] = useState('#ffffff')

  const keyDownHandler = (e: React.KeyboardEvent<HTMLDivElement>) => {
    const key = e.code;

    if (key === 'ArrowUp') {
      setTop((top) => top - 10);
    }

    if (key === 'ArrowDown') {
      setTop((top) => top + 10);
    }

    if (key === 'ArrowLeft') {
      setLeft((left) => left - 10);
    }

    if (key === 'ArrowRight') {
      setLeft((left) => left + 10);
    }

    if (key === 'Space') {
      let color = Math.floor(Math.random() * 0xFFFFFF).toString(16);
      for(let count = color.length; count < 6; count++) {
        color = '0' + color;                     
      }
      setBackgroundColor('#' + color);
    }
  }

  return (
    <div
      className="container"
      tabIndex={0}
      onKeyDown={keyDownHandler}
    >
      <div
        className="box"
        style={{ 
          top: top,
          left: left,
          backgroundColor: backgroundColor,
        }}></div>
    </div>
  );
}

export default App;
node *findMid(node *head) {
  node *slow = head;
  node *fast = head->next;
  while (fast != NULL && fast->next != NULL) {
    slow = slow->next;
    fast = fast->next->next;
  }
  return slow;
}

node *merge(node *left, node *right) {
  if (left == NULL) {
    return right;
  }
  if (right == NULL) {
    return left;
  }
  node *ans = new node(-1);
  node *temp = ans;
  while (left != NULL && right != NULL) {
    if (left->data < right->data) {
      temp->next = left;
      temp = left;
      left = left->next;
    } else {
      temp->next = right;
      temp = right;
      right = right->next;
    }
  }
  while (left != NULL) {
    temp->next = left;
    temp = left;
    left = left->next;
  }
  while (right != NULL) {
    temp->next = right;
    temp = right;
    right = right->next;
  }
  ans = ans->next;
  return ans;
}

node *mergeSort(node *head) {
  // base case
  if (head == NULL || head->next == NULL) {
    return head;
  }
  // breaking the linked list into two halves
  node *mid = findMid(head);
  node *first = head;
  node *second = mid->next;
  mid->next = NULL;
  // recursive call
  first = mergeSort(first);
  second = mergeSort(second);
  // merging the two sorted halves
  node *result = merge(first, second);
  return result;
}
List<Account> accountList = [
    SELECT Id, Name, AccountNumber FROM Account WHERE Name LIKE 'Test Account - %' 
    LIMIT 10
];

Datetime startDttm = System.now();
Map<String, SObject> acctMapByNbr = 
    MapCreator.createMapByIndex( accountList, 'AccountNumber' );
system.debug( 'MapCreator -> ' + ( System.now().getTime() - startDttm.getTime() ) );

startDttm = System.now();
Map<String, SObject> acctMapByNbr2 = 
    new Map<String, SObject>();
for( Account anAccount : accountList ) {
	acctMapByNbr2.put( String.valueOf( anAccount.AccountNumber ), anAccount );
}
system.debug( 'standard map creation -> ' + ( System.now().getTime() - startDttm.getTime() ) );
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 Microsoft.OpenApi.Models;

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 = System.Text.Json.Serialization.ReferenceHandler.Preserve;
    });

// 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.Events = new JwtBearerEvents
                    {
                        OnAuthenticationFailed = context =>
                        {
                            context.Response.Headers.Add("Authentication-Failed", context.Exception.Message);
                            return Task.CompletedTask;
                        },
                        OnTokenValidated = context =>
                        {
                            var logger = context.HttpContext.RequestServices.GetRequiredService<ILogger<StartupBase>>();
                            logger.LogInformation("Token validated for user: {0}", context.Principal.Identity.Name);
                            return Task.CompletedTask;
                        }
                    };
                    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(c =>
{
    // Add JWT Authentication to Swagger
    c.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme
    {
        Description = @"JWT Authorization header using the Bearer scheme. \r\n\r\n 
          Enter 'Bearer' [space] and then your token in the text input below.
          \r\n\r\nExample: 'Bearer 12345abcdef'",
        Name = "Authorization",
        In = ParameterLocation.Header,
        Type = SecuritySchemeType.ApiKey,
        Scheme = "Bearer"
    });

    c.AddSecurityRequirement(new OpenApiSecurityRequirement()
    {
        {
            new OpenApiSecurityScheme
            {
                Reference = new OpenApiReference
                {
                    Type = ReferenceType.SecurityScheme,
                    Id = "Bearer"
                },
                Scheme = "oauth2",
                Name = "Bearer",
                In = ParameterLocation.Header,
            },
            new List<string>()
        }
    });
});

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();
//Method before error
loadRewardTypes(): void {
    this.rewardTypeService.getAllRewardTypes().subscribe((rewardTypes: RewardTypeViewModel[]) => {
      this.rewardTypes = rewardTypes;
      this.filteredRewardTypes = rewardTypes;
    });
  }
  
//Method after error
loadRewardTypes(): void {
    this.rewardTypeService.getAllRewardTypes().subscribe({
      next: (rewardTypes: RewardTypeViewModel[]) => {
        console.log('API Response:', rewardTypes); // Check if the data is an array
        this.rewardTypes = Array.isArray(rewardTypes) ? rewardTypes : [];
        this.filteredRewardTypes = this.rewardTypes;
        console.log('Assigned rewardTypes:', this.rewardTypes); // Confirm assignment
      },
      error: (error) => {
        console.error('Error loading reward types:', error);
      }
    });
  }
App\Models\Category {#310 ▼ // resources\views/courses/show.blade.php
  #connection: null
  #table: null
  #primaryKey: "id"
  #keyType: "int"
  +incrementing: true
  #with: []
  #withCount: []
  +preventsLazyLoading: false
  #perPage: 15
  +exists: false
  +wasRecentlyCreated: false
  #escapeWhenCastingToString: false
  #attributes: []
  #original: []
  #changes: []
  #casts: []
  #classCastCache: []
  #attributeCastCache: []
  #dateFormat: null
  #appends: []
  #dispatchesEvents: []
  #observables: []
  #relations: []
  #touches: []
  +timestamps: true
  +usesUniqueIds: false
  #hidden: []
  #visible: []
  #fillable: array:2 [▶]
  #guarded: array:1 [▶]
}
onSubmit() {
    if (this.profileForm.valid) {
      const userId = JSON.parse(localStorage.getItem('User')!).userId;
      this.userService.updateUser(userId, this.profileForm.value).subscribe({
        next: (result) => {
          console.log('User to be updated:', result);
          this.router.navigateByUrl(`/ProfilePage/${userId}`);
          alert('Successfully updated profile');
        },
        error: () => {
          console.error('Error updating user profile:');
          alert('Error updating profile');
        }
      });
    }
  }

onPhotoChange(event: Event): void {
    if (!this.isEditMode) return;

    const input = event.target as HTMLInputElement;
    if (input.files && input.files[0]) {
      const reader = new FileReader();
      reader.onload = (e: any) => {
        this.userProfileImage = e.target.result; // Update the image source
        this.profileForm.patchValue({ photo: e.target.result }); // Update the form control
      };
      reader.readAsDataURL(input.files[0]);
    }
  }
<link href="splendor.css" rel="stylesheet">
<script type="application/ld+json">
{
  "@context": "https://schema.org/", 
  "@type": "Product", 
  "name": "Terminus Developers",
  "image": "https://terminus-developers.com/wp-content/themes/terminus/assets/images/projects/_MG_4516.webp",
  "description": "Terminus Developers: Offering Premium Building Construction, Real Estate Services, and a Range of Flats, Plots, and Apartments in TSPA Junction, Kokapet, Kollur, Hyderabad.",
  "brand": {
    "@type": "Brand",
    "name": "Terminus"
  },
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "4.7",
    "bestRating": "5",
    "worstRating": "1",
    "ratingCount": "836"
  }
}
</script>
<script src="https://rawcdn.githack.com/oscarmorrison/md-page/232e97938de9f4d79f4110f6cfd637e186b63317/md-page.js"></script><noscript>
List<Account> accountList = [
    SELECT Id, Name, AccountNumber 
    FROM Account 
    WHERE Name LIKE 'Test Account - %' 
        AND AccountNumber != NULL
    LIMIT 5
];

Map<String, Object> paramMap = 
    new Map<String, Object>{ 'records' => JSON.serialize( accountList )
                        , 'fieldName' => 'AccountNumber' };
DataWeave.Script dwScript = 
    DataWeave.Script.createScript( 'ListToMap' );
DataWeave.Result result = dwScript.execute( paramMap );

String resultString = result.getValueAsString();
// system.debug( resultString );

Map<String, SObject> objMap = (Map<String, SObject>)
    JSON.deserialize( resultString, Map<String, SObject>.class );

system.debug( objMap );
system.debug( objMap.get( '1' ) );
system.debug( objMap.get( '101' ) );
%dw 2.0
input records application/json
input fieldName text
output application/json
---
{(records map (record) -> 
    ( record[ fieldName ] ) : record 
)}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
video {
  width: 100%;
  height: auto;
}
</style>
</head>
<body>
​
<video width="400" controls>
  <source src="mov_bbb.mp4" type="video/mp4">
  <source src="mov_bbb.ogg" type="video/ogg">
  Your browser does not support HTML5 video.
</video>
​
<p>Resize the browser window to see how the size of the video player will scale.</p>
​
</body>
</html>
​
​
​
node* sortList (node* head) {
  int zeroCount = 0;
  int oneCount = 0;
  int twoCount = 0;
  node* temp = head;
  while (temp != NULL) {
    if (temp -> data == 0) {
      zeroCount++;
    }
    else if (temp -> data == 0) {
      oneCount++;
    }
    else if (temp -> data == 0) {
      twoCount++;
    }
    temp = temp -> next;
  }
  temp = head;
  while (temp != NULL) {
    if (zeroCount != 0) {
      temp -> data = 0;
      zeroCount--;
    }
    else if (oneCount != 0) {
      temp -> data = 1;
      oneCount--;
    }
    else if (twoCount != 0) {
      temp -> data = 2;
      twoCount--;
    }
    temp = temp -> next;
  }
  return temp;
}
void removeLoop(node *head) {
  if (head == NULL) {
    return;
  }
  node *startOfLoop = getStartingNode(head);
  node *temp = startOfLoop;
  while (temp->next != startOfLoop) {
    temp = temp->next;
  }
  temp->next = NULL;
  cout << "loop is removed " << endl;
}
node *floyedDetectionLoop(node *head) {
  if (head == NULL) {
    return NULL;
  }
  node *fast = head;
  node *slow = head;
  while (fast != NULL && slow != NULL) {
    fast = fast->next;
    if (fast->next != NULL) {
      fast = fast->next;
    }
    slow = slow->next;
    if (fast == slow) {
      return slow;
    }
  }
  return NULL;
}

node *getStartingNode(node *head) {
  if (head == NULL) {
    return NULL;
  }
  node *intersection = floyedDetectionLoop(head);
  node *slow = head;
  while (slow != intersection) {
    slow = slow->next;
    intersection = intersection->next;
  }
  return slow;
}
function onOpen() {
  var ui = SpreadsheetApp.getUi();
  ui.createMenu('Custom Tools')
      .addItem('Remove Blank Rows', 'removeBlankRows')
      .addToUi();
}

function removeBlankRows() {
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  var range = sheet.getDataRange();
  var values = range.getValues();
  var rowsToDelete = [];

  // Loop through all rows and check for blank rows
  for (var i = values.length - 1; i >= 0; i--) {
    var isBlank = values[i].every(function(cell) { return cell === ''; });
    if (isBlank) {
      rowsToDelete.push(i + 1);
    }
  }

  // Delete rows in reverse order to avoid shifting indices
  for (var j = 0; j < rowsToDelete.length; j++) {
    sheet.deleteRow(rowsToDelete[j]);
  }
}
/**
 * Create the test data, ideally run 1 by 1 to prevent govenor limits
 * Run accounts and contacts first. Cases and opportunities require both
 */
upsertAccounts(0,10);
upsertContacts(0,10,0,10);
upsertCases(0,10,0,10);
upsertOpportunities(0,10,0,10);

/**
 * @description Method to create Basic Test Contacts
 */
public void upsertAccounts(Integer accountOffset, Integer numberOfAccounts){
    
    // List to store the new cases
    Account[] accounts = new Account[]{};

    // Loop for to create all top level accounts
    for (Integer i = accountOffset; i < numberOfAccounts; i++) {
    
        // A postfix to keep track of what item we're dealing with
        String postfix = String.valueOf(i+1).leftPad(4,'0');
        
        // Create a new account
        accounts.add(new Account(
            Name           = 'LWT - Test - Account - ' + postfix,
            UUID__c        = UUID.randomUUID().toString(),
            External_Id__c = 'ACC - ' + postfix
        ));
    }
    upsert accounts External_Id__c;
}


/**
 * @description Method to create Basic Test Contacts
 */
public void upsertContacts(Integer accountOffset, Integer numberOfAccounts, Integer contactOffset,Integer numberOfContacts){
    
    // Get the account and contact data
    Account[] accounts = [SELECT Id FROM Account WHERE Name LIKE 'LWT - Test - %' ORDER BY Name ASC LIMIT :numberOfAccounts];
    
    // Basic error handling
    if(numberOfAccounts != accounts.size()){throw new StringException('Number of accounts does not match number returned by the query');}
    
    // List to store the new contacts
    Contact[] contacts = new Contact[]{};

    // Iterate the top level accounts
    for(Integer i=accountOffset; i<numberOfAccounts; i++){
        
        // Create a number of contacts for each account
        for(Integer j=contactOffset; j < numberOfContacts; j++){
        
            // Postfix to keep track of where we are
            String postfix = String.valueOf(i+1).leftPad(4,'0') + ' - ' + String.valueOf(j+1).leftPad(4,'0');
            
            // Add a new contact to the list
            contacts.add(new Contact(
                AccountId      = accounts[i].Id,
                FirstName      = 'LWT - Test - ' + postfix,
                LastName       = 'Contact - ' + postfix,
                UUID__c        = UUID.randomUUID().toString(),
                External_Id__c = 'CON - ' + postfix
            ));
        }
    }
    upsert contacts External_Id__c;
}


/**
 * @description Method to create Basic Test Cases
 */
public void upsertCases(Integer offset, Integer numberOfAccounts, Integer contactOffset, Integer numberOfContacts){

    // Get the account and contact data
    Account[] accounts = [SELECT Id FROM Account WHERE Name LIKE 'LWT - Test - %' ORDER BY Name ASC LIMIT :numberOfAccounts];
    Contact[] contacts = [SELECT Id FROM Contact WHERE Name LIKE 'LWT - Test - %' ORDER BY Name ASC LIMIT :numberOfContacts];

    // Basic error handling
    if(numberOfAccounts != accounts.size()){throw new StringException('Number of accounts does not match number returned by the query');}
    if(numberOfContacts != contacts.size()){throw new StringException('Number of contacts does not match number returned by the query');}

    // List to store the new cases
    Case[] cases = new Case[]{};

    // Iterate the top level accounts
    for(Integer i=offset; i<numberOfAccounts; i++){
        
        // Create a case for each contact in the account
        for(Integer j=offset; j<numberOfContacts; j++){
        
            // Postfix to keep track of where we are
            String postfix = String.valueOf(i+1).leftPad(4,'0') + ' - ' + String.valueOf(j+1).leftPad(4,'0');
            
            // Add a new case
            cases.add(new Case(
                AccountId      = accounts[i].Id,
                ContactId      = contacts[j].Id,
                Subject        = 'LWT - Test - Case - ' + postfix,
                UUID__c        = UUID.randomUUID().toString(),
                External_Id__c = 'CSE - ' + postfix
            ));
        }
    }
    upsert cases External_Id__c;
}


/**
 * @description Method to create Basic Test Opportunities
 */
public void upsertOpportunities(Integer offset, Integer numberOfAccounts, Integer contactOffset, Integer numberOfContacts){
    
    // Get the account and contact data
    Account[] accounts = [SELECT Id FROM Account WHERE Name LIKE 'LWT - Test - %' ORDER BY Name ASC LIMIT :numberOfAccounts];
    Contact[] contacts = [SELECT Id FROM Contact WHERE Name LIKE 'LWT - Test - %' ORDER BY Name ASC LIMIT :numberOfContacts];

    // Basic error handling
    if(numberOfAccounts != accounts.size()){throw new StringException('Number of accounts does not match number returned by the query');}
    if(numberOfContacts != contacts.size()){throw new StringException('Number of contacts does not match number returned by the query');}
    
    // List to store the new cases
    Opportunity[] opportunities = new Opportunity[]{};

    // Iterate the top level accounts
    for(Integer i=offset; i<numberOfAccounts; i++){
        
        // Create an opportunity for each contact in the account
        for(Integer j=offset; j<numberOfContacts; j++){
        
            // Postfix to keep track of where we are
            String postfix = String.valueOf(i+1).leftPad(4,'0') + ' - ' + String.valueOf(j+1).leftPad(4,'0');
            
            // Add a new opportunity to the list
            opportunities.add(new Opportunity(
                AccountId      = accounts[i].Id,
                ContactId      = contacts[j].Id,
                Name           = 'LWT - Test - Opportunity - ' + postfix,
                StageName      = (Math.mod(j,2) == 0) ? 'New' : 'Closed/Won',
                CloseDate      = Date.today().addDays(j),
                UUID__c        = UUID.randomUUID().toString(),
                External_Id__c = 'OPP - ' + postfix
            ));
        }
    }
    upsert opportunities External_Id__c;
}
#include<stdio.h>
void interchange(int a[],int i,int j){
	int p=a[i];
	a[i]=a[j];
	a[j]=p;
}

int partition(int a[],int m,int p){
	int v=a[m],i=m,j=p;
	
	do{
		do{
			i=i+1;
		}while(a[i] < v);
		do{
			j=j-1;
		}while(a[j] > v);

		if(i<j){
			interchange(a,i,j);
		}
	}while(i < j);
	a[m]=a[j];
	a[j]=v;
	return j;
}



void QuickSort(int a[],int p,int q){
	if(p<q){
		int j=partition(a,p,q+1);
		QuickSort(a,p,j-1);
		QuickSort(a,j+1,q);
	}
}

int main(){
	int n;
	printf("Enter the size of array : ");
	scanf(" %d",&n);

	int a[n];
	for(int i=0;i<n;i++){
		printf("Enter the element %d : ",(i+1));
		scanf(" %d",&a[i]);		
	}

	QuickSort(a,0,n-1);
	printf("Sorted array is ");
	for(int i=0;i<n;i++){
		printf(" %d",a[i]);
	}

return 0;}
bool floyedDetectionLoop (node* head) {
  if (head == NULL) {
    return false;
  }
  node* fast = head;
  node* slow = head;
  while (fast != NULL && slow != NULL) {
    fast = fast -> next;
    if (fast -> next == NULL) {
      fast = fast -> next;
    }
    slow = slow -> next;
    if (fast == slow) {
      return true;
    }
    
  }
  return false;
}
🖌️ 3D Artist & Developer of Zombie Rush! 🧟‍♂️
💬 Messages are open to everyone. Feel free to ask questions, make suggestions or let me know about bugs in Zombie Rush!

🛒 Shop my UGC! 👉 www.roblox.com/catalog/?Category=11&CreatorName=FracturedSkies
🖌️ 3D Artist & Developer of Zombie Rush! 🧟‍♂️
💬 Messages are open to everyone. Feel free to ask questions, make suggestions or let me know about bugs in Zombie Rush!

🛒 Shop my UGC! 👉 www.roblox.com/catalog/?Category=11&CreatorName=FracturedSkies
bool detectLoop (node* head) {
  if (head == NULL) {
    return false;
  }
  map <node*, bool> visited;
  node* temp = head;
  while (temp != NULL) {
    if (visited[temp] == true) {
      return true;
    }
    visited[temp] = true;
    temp = temp -> next;
  }
  return false;
}
// check if a linked list is circular or not
bool isCircular (node* head) {
  if (head == NULL) {
    return true;
  }
  node* temp = head -> next;
  while (temp != NULL && temp != head) {
    temp = temp -> next;
  }
  if (temp == head) {
    return true;
  }
  return false;
}
node* kReverse (node* head, int k) {
  // base case
  if (head == NULL) {
    return NULL;
  }

  // step 1: reverse first k nodes
  node* forward = NULL;
  node* curr = head;
  node* prev = NULL;
  int cnt = 0;
  while (curr != NULL && cnt < k) {
    forward = curr -> next;
    curr -> next = prev;
    prev = curr;
    curr = forward;
    cnt++;
    
  }
  // step 2: recursion
  if (forward != NULL) {
    head -> next = kReverse(forward, k);
    
  }
  // step 3: return head of the modified list
  return prev;
}
function generateButtons(buttons) {
    // get the dataset value
    let uniqueCategories = [...new Set()];

    buttons.forEach((button) => {
      const category = button.dataset.category;
      uniqueCategories.push(category);
    });

    uniqueCategories = uniqueCategories.filter(function (item, pos) {
      return uniqueCategories.indexOf(item) == pos;
    });

    uniqueCategories.unshift("All");

    console.log(uniqueCategories);

    // return ` <button type="button" class="filter-btn" data-id="${category}">${category}</button>`;
  }
Diversie dashboards, analyses en rapportages werkbladen obv. het dagelijks ververste Proactis datamodel. 
int getLength (node* head) {
  int length = 0;
  node* temp = head;
  while (temp != NULL) {
    length++;
    temp = temp -> next;
  }
  return length;
}

node* middleNode (node* head) {
  int length = getLength(head);
  int mid = (length/2) + 1;
  int cnt = 1;
  node* temp = head;
  while (cnt < mid) {
    temp = temp -> next;
    cnt++;
  }
  return temp;
}
node* reverseLinkedList (node* & head) {
  //empty list or single node
  if (head == NULL || head -> next == NULL) {
    return head;
  }
  node* prev = NULL;
  node* curr = head;
  node* forword = NULL;
  while (curr != NULL) {
    forword = curr -> next;
    curr -> next = prev;
    prev = curr;
    curr = forword;
  }
  return prev;
}
// it will return the head of the reversed linked list
node* reverse1 (node* head) {
  // base case
  if (head == NULL || head -> next == NULL) {
    return head;
  }
  node* chotaHead = reverse1(head -> next) {
    head -> next -> next = head;
    head -> next = NULL;

    return chotaHead;
  }
}
node* reverseLinkedList (node* head) {
  // empty  list 
	if (head == NULL || head -> next == NULL) {
	return head;
	}
  node* prev = NULL;
  node* curr = head;
  node* forword = NULL;
  
  while (curr != NULL) {
	forword = curr -> next;
    curr -> next = prev;
    prev = curr;
    curr = forword;
  }
  return prev;
}
.more-less .e-n-accordion-item span.mniej {
    display: none;
}

.more-less.elementor-widget-n-accordion .e-n-accordion-item[open] .e-n-accordion-item-title span.more {
    display: none;
}
.more-less.elementor-widget-n-accordion .e-n-accordion-item[open] .e-n-accordion-item-title span.less {
    display: inline;
}
function sum(...numbers) {
  // The rest operator is three dots followed by the variable name; by convention, it is typically called 'rest'
  // The rest operator must be the last parameter in the function definition
  return numbers.reduce((acc, val) => acc + val, 0);
}   // The reduce method is used to sum all the numbers in the array
dataGridView1.Columns[0].DefaultCellStyle.WrapMode = DataGridViewTriState.True;
dataGridView1.Rows.Add("test" + Environment.NewLine + "test");
Optimize your business operations with distinctively designed smart contract solutions specially crafted for every industry. Maticz is a leading smart contract development agency that helps businesses automate transactions when certain criteria are fulfilled. 
As the smart contract uses blockchain technology, data is secured from hacking attempts. We are experts at designing customized solutions for the business, for the specific business requirements. Collaborate with our trusted solutions, to build a transparent and secure system.
<img src="your-image.jpg" alt="description" class="responsive-image">
  //1st way
.responsive-image {
  max-width: 100%;
  height: auto;
}
//2nd way
.responsive-image {
  width: 100%;
  height: auto;
}

<div class="responsive-background"></div>
//3rd way
  .responsive-background {
  width: 100%;
  height: 300px; /* Or any desired height */
  background: url('your-image.jpg') no-repeat center center;
  background-size: cover;
}

//4th way
<picture>
  <source srcset="small.jpg" media="(max-width: 600px)">
  <source srcset="medium.jpg" media="(max-width: 1200px)">
  <img src="large.jpg" alt="description" class="responsive-image">
</picture>
.responsive-image {
  width: 100%;
  height: auto;
}
/**
 * Method to test Fernando's F' map trick
 */

// Query a 1000 records
Account[] records = [SELECT Id,Name FROM Account WHERE Name LIKE 'Test Account - %' LIMIT 1000];

// Use Fernando's MapCreator Method to 
Integer fst = Limits.getCpuTime();
Map<String, SObject> fMap = (Map<String, SObject>) MapCreator.createMapByIndex(records, 'Name' );
Integer fet = Limits.getCpuTime();
System.debug('"Fernanados" method: ' + (fet-fst) + 'ms - Number of records:' + fMap.size());


// Use a traditional for loop
Integer tst = Limits.getCpuTime();
Map<String, SObject> tMap = new Map<String, SObject>();
for(Integer i=0,max=records.size();i<max;i++){
    tMap.put(records[i].name,records[i]);
}
Integer tet = Limits.getCpuTime();
System.debug('"Traditional" method: ' + (tet-tst) + 'ms - Number of records:' + tMap.size());



/**
 * https://learnsf.wordpress.com/2014/12/29/trick-how-to-obtain-a-map-indexed-by-any-field-not-just-id-faster-and-without-loops/
 */
public class MapCreator {
    
    public static Map<String, SObject> createMapByIndex(List<SObject> aList, String indexField ) {
    
        // get the list in JSON format
        String jsonList = JSON.serialize( aList );
        
        // remove enclosing []
        jsonList = jsonList.substring( 1, jsonList.length() - 1 );
        
        // copy the indexField value in front of each
        // {} group using RegEx substitution
        // example result: value:{…"indexField":"value"…}
        jsonList = '{' + jsonList.replaceAll('(\\{.*?"' + indexField + '":"(.*?)"(,".*?")*\\},?)', '"$2":$1' ) + '}';
        
        // create map from the modified JSON
        Map<String, SObject> changedMap = (Map<String, SObject>) JSON.deserialize( jsonList, Map<String, SObject>.class );
        
        return changedMap;
    }
}
public class Palindrome {
    public static void main(String[] args) {
     String str="abcdcba";
        System.out.println(isPalindrome(str));
        System.out.println(str.length()/2);

    }
   static boolean isPalindrome(String str) {
        str = str.toLowerCase();
        for (int i = 0; i < str.length() / 2; i++) {
          char start=str.charAt(i);
          char end=str.charAt(str.length() - i -  1);

          if (start != end) {
              return false;
          }
        }
        return true;
   }
}
star

Sun Jul 21 2024 02:58:48 GMT+0000 (Coordinated Universal Time)

@destinyChuck #html #css #javascript

star

Sun Jul 21 2024 01:15:18 GMT+0000 (Coordinated Universal Time) undefined

@maridann1022

star

Sat Jul 20 2024 17:23:52 GMT+0000 (Coordinated Universal Time) https://youtu.be/BmZnJehDzyU?list=PLDzeHZWIZsTryvtXdMr6rPh4IDexB5NIA

@vishnu_jha ##c++ ##dsa ##loop ##algorithm #stack #parenthesis #validparenthesis

star

Sat Jul 20 2024 14:29:46 GMT+0000 (Coordinated Universal Time) https://zenn.dev/gashi/articles/20211209-article013

@maridann1022 #javascript #reac #type #typescript

star

Sat Jul 20 2024 13:48:17 GMT+0000 (Coordinated Universal Time) lecture 53 dsa babbar

@vishnu_jha ##c++ ##dsa ##linkedlist ##circular ##loop #floyd'sloopdetection ##algorithm #mergesort

star

Sat Jul 20 2024 12:59:11 GMT+0000 (Coordinated Universal Time)

@taurenhunter

star

Sat Jul 20 2024 12:29:24 GMT+0000 (Coordinated Universal Time)

@iamkatmakhafola

star

Sat Jul 20 2024 12:26:19 GMT+0000 (Coordinated Universal Time)

@iamkatmakhafola

star

Sat Jul 20 2024 12:05:06 GMT+0000 (Coordinated Universal Time) http://localhost:8000/courses/1

@bekzatkalau

star

Sat Jul 20 2024 10:16:17 GMT+0000 (Coordinated Universal Time)

@iamkatmakhafola

star

Sat Jul 20 2024 09:54:20 GMT+0000 (Coordinated Universal Time)

@sty003 #html

star

Sat Jul 20 2024 09:52:22 GMT+0000 (Coordinated Universal Time) https://sub.shaheenenclave.com/

@isamardev

star

Sat Jul 20 2024 09:32:03 GMT+0000 (Coordinated Universal Time) http://octoprint.local/

@amccall23

star

Sat Jul 20 2024 09:31:44 GMT+0000 (Coordinated Universal Time) http://octoprint.local/

@amccall23

star

Sat Jul 20 2024 08:02:58 GMT+0000 (Coordinated Universal Time) https://www.coursera.org/learn/machine-learning/ungradedLab/7GEJh/optional-lab-multiple-linear-regression/lab?path

@wowthrisha

star

Sat Jul 20 2024 07:09:35 GMT+0000 (Coordinated Universal Time) https://terminus-developers.com/

@Zampa #html

star

Sat Jul 20 2024 06:13:14 GMT+0000 (Coordinated Universal Time)

@sty003 #html

star

Fri Jul 19 2024 22:20:54 GMT+0000 (Coordinated Universal Time) https://modly.netlify.app/

@nnjkjjkjk

star

Fri Jul 19 2024 21:52:09 GMT+0000 (Coordinated Universal Time)

@taurenhunter

star

Fri Jul 19 2024 15:09:10 GMT+0000 (Coordinated Universal Time) https://www.w3schools.com/css/tryit.asp?filename

@ElyasAkbari #undefined

star

Fri Jul 19 2024 12:48:09 GMT+0000 (Coordinated Universal Time) https://youtu.be/ogmBt6f9hw8?list=PLDzeHZWIZsTryvtXdMr6rPh4IDexB5NIA

@vishnu_jha ##c++ ##dsa ##linkedlist ##circular ##loop #floyd'sloopdetection ##algorithm

star

Fri Jul 19 2024 11:08:49 GMT+0000 (Coordinated Universal Time)

@roamtravel

star

Fri Jul 19 2024 11:01:38 GMT+0000 (Coordinated Universal Time)

@Justus

star

Fri Jul 19 2024 10:44:34 GMT+0000 (Coordinated Universal Time) https://www.blockchainappfactory.com/crypto-marketing-agency

@albertpeter

star

Fri Jul 19 2024 09:52:03 GMT+0000 (Coordinated Universal Time)

@signup

star

Fri Jul 19 2024 06:42:54 GMT+0000 (Coordinated Universal Time) https://www.roblox.com/users/13540173/profile

@Vitinlonlon73

star

Fri Jul 19 2024 06:42:38 GMT+0000 (Coordinated Universal Time) https://www.roblox.com/users/13540173/profile

@Vitinlonlon73

star

Fri Jul 19 2024 06:37:38 GMT+0000 (Coordinated Universal Time) https://youtu.be/VxOFflTXlXo?list=PLDzeHZWIZsTryvtXdMr6rPh4IDexB5NIA

@vishnu_jha ##c++ ##dsa ##linkedlist ##circular ##loop

star

Fri Jul 19 2024 06:27:21 GMT+0000 (Coordinated Universal Time) https://youtu.be/fi2vh0nQLi0?list=PLDzeHZWIZsTryvtXdMr6rPh4IDexB5NIA

@vishnu_jha #c++ #dsa #linkedlist #reverselinkedlist #recursion #circular

star

Fri Jul 19 2024 06:09:29 GMT+0000 (Coordinated Universal Time) https://youtu.be/fi2vh0nQLi0?list=PLDzeHZWIZsTryvtXdMr6rPh4IDexB5NIA

@vishnu_jha #c++ #dsa #linkedlist #reverselinkedlist #recursion

star

Fri Jul 19 2024 06:03:42 GMT+0000 (Coordinated Universal Time)

@davidmchale #function #filter

star

Fri Jul 19 2024 04:43:42 GMT+0000 (Coordinated Universal Time)

@bogeyboogaard

star

Fri Jul 19 2024 04:14:41 GMT+0000 (Coordinated Universal Time) https://youtu.be/vqS1nVQdCJM

@vishnu_jha #c++ #dsa #linkedlist #reverselinkedlist #recursion

star

Fri Jul 19 2024 04:13:46 GMT+0000 (Coordinated Universal Time) https://youtu.be/vqS1nVQdCJM

@vishnu_jha #c++ #dsa #linkedlist #reverselinkedlist #recursion

star

Thu Jul 18 2024 17:17:04 GMT+0000 (Coordinated Universal Time) https://youtu.be/vqS1nVQdCJM

@vishnu_jha #c++ #dsa #linkedlist #reverselinkedlist

star

Thu Jul 18 2024 17:12:19 GMT+0000 (Coordinated Universal Time) https://www.youtube.com/watch?v=IzvCG7v1KHg

@webisko #css

star

Thu Jul 18 2024 16:18:58 GMT+0000 (Coordinated Universal Time)

@destinyChuck #html #css #javascript

star

Thu Jul 18 2024 14:55:38 GMT+0000 (Coordinated Universal Time) https://sweetalert2.github.io/

@poramet128

star

Thu Jul 18 2024 14:55:32 GMT+0000 (Coordinated Universal Time) https://sweetalert2.github.io/

@poramet128

star

Thu Jul 18 2024 13:38:05 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/1706454/c-multiline-text-in-datagridview-control

@javicinhio

star

Thu Jul 18 2024 12:52:40 GMT+0000 (Coordinated Universal Time) https://maticz.com/smart-contract-development

@carolinemax ##maticz ##usa #smart_contract #smart_contract_development

star

Thu Jul 18 2024 09:52:09 GMT+0000 (Coordinated Universal Time)

@ishwarpatel100 #css #images

star

Thu Jul 18 2024 09:33:49 GMT+0000 (Coordinated Universal Time)

@Justus

star

Thu Jul 18 2024 08:22:46 GMT+0000 (Coordinated Universal Time) https://ocr.space/copyfish/welcome?b

@rozzanxettri

star

Thu Jul 18 2024 08:06:25 GMT+0000 (Coordinated Universal Time)

@Mohanish

Save snippets that work with our extensions

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