Skip to content

Instantly share code, notes, and snippets.

View ExpandingShapes's full-sized avatar
🔬
My goal's in sight

Alexander ExpandingShapes

🔬
My goal's in sight
View GitHub Profile
@ExpandingShapes
ExpandingShapes / gist:1df6ecb8bc80ace3c93fa88c7e6f9a75
Created May 12, 2024 19:01
Apex Legends not launching after S21 update
======================
Proton: 1715119560 hotfix-20240508-thefinals-apex
SteamGameId: 1172470
Command: ['/home/alexander/.local/share/Steam/steamapps/common/Apex Legends/start_protected_game.exe', '-steam']
Options: {'forcelgadd', 'none'}
depot: 0.20240415.84603
pressure-vessel: 0.20240415.0 scout
scripts: 0.20240415.0
sniper: 0.20240415.84603 sniper 0.20240415.84603
Kernel: Linux 6.8.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 02 May 2024 17:49:46 +0000 x86_64
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Random;
public class Main {
public static void main(String[] args) {
String rawPassword = args[0];
String sault = generateSalt();
String encodedPassword = encode(sault + rawPassword);
@ExpandingShapes
ExpandingShapes / anagramSubstringSearch.kt
Created October 12, 2021 13:07
we are given two strings text and pattern of size n and m respectively where m < n. Our task is to find all the indices in text where anagrams of pattern are found.
private fun findIndices(text: String, pattern: String): List<Int> {
val n = text.length
val m = pattern.length
val indices: MutableList<Int> = ArrayList()
// Frequency arrays - assuming we have a set of 256 characters
val textCount = IntArray(256)
val patternCount = IntArray(256)
// Loop until m
@ExpandingShapes
ExpandingShapes / maximumSumOfKConsecutiveElements.kt
Last active October 12, 2021 12:30
Given an array of n integers and size k, where k < n, find the maximum sum of k consecutive elements in the array.
fun findMaximumSum(a: IntArray, k: Int): Int {
var currentSum: Int = 0
var maximumSum: Int
for (i in 0 until k) {
currentSum += a[i]
}
maximumSum = currentSum
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
$, = " ";
sub GetUniqueSorted {
my (@arr) = @_;
my %uniqueHash = ();
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
$, = ", ";
sub GetSymmetricDifference {
my (@firstArr, @secondArr) = @_;
my %uniqueHash = ();
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
my $num = 10;
my @arrWithNum = (1, 2, 3, 10, 9, 11, 12);
my @arrWithoutNum = (1, 2, 4, 5, 3, 8, 9);
sub Exists {
@ExpandingShapes
ExpandingShapes / [Scheme] square root
Created January 16, 2019 20:26
Eval square root by Newton's method
(define (average x y)(/(+ x y) 2))
(define square(lambda (x)(* x x)))
(define (my-abs x)
(cond ((< x 0)(- x))
((= x 0) 0)
((> x 0) x)))
(define (my-sqrt x)