Skip to content

Instantly share code, notes, and snippets.

@bsadia
bsadia / Advent-of-Code-2022.md
Last active January 5, 2023 16:52
Advent of code 2022 in Julia

Advent of Code 2022 in Julia

Day 01:

# initialization
elf_calories = 0 # stores calories for each elf
max_elf_calories = 0 # stores maximum calories
list_elf_calories = [] # A list to store each elf's total calories 
for l in calories
	if !isempty(l)
		elf_calories +=  l
@bsadia
bsadia / KB-Buying-gude-EU.md
Created March 24, 2021 08:31 — forked from henfiber/KB-Buying-guide-EU.md
Buying keyboards and keyboard components from EU

Europe

@bsadia
bsadia / mendeley-install.sh
Created March 10, 2021 08:21 — forked from wvega/mendeley-install.sh
Install Mendeley on Fedora
#!/bin/sh
ARCH=`uname -m`
INSTALL=/usr/local/mendeley
# As noted by Narendiran Anandan in http://disq.us/26v7yj,
# required OpenSSL libraries are availabe only at the following locations:
# http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/11/Fedora/x86_64/os/Packages/openssl-0.9.8k-1.fc11.x86_64.rpm
# http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/11/Fedora/i386/os/Packages/openssl-0.9.8k-1.fc11.i586|i686.rpm
case $ARCH in
@bsadia
bsadia / MultipleOf3Or5.md
Last active March 23, 2018 21:15
Sum of multiples of 3 or 5 below 1000

Project Euler Question 1

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000.

Solution 1

Sum = 0;
for i=1:999
    if(rem(i,3)==0 || rem(i,5)==0)
 Sum = Sum + i;