Skip to content

Instantly share code, notes, and snippets.

@officialcjunior
officialcjunior / Avial-downloader.md
Last active December 13, 2022 17:48
Avial-downloader

Avial-downloader

This script is to download all the songs released by the Indian alternative rock band Avial, in the highest quality possible.

Track list

  • All the songs from the studio album Avial(2008)
  • All the four singles : Aanakallan, Ayyo!, Thithithara, Arambath
  • "Chi Me Sape"- The song born after collaborating with Italian band A67.
@officialcjunior
officialcjunior / power_of_two.c
Last active July 1, 2020 05:19
A program to find the powers of two using bits, without a loop or any other functions.
#include <stdio.h>
int main ()
{
int n, val;
printf("Enter the value for n \n");
scanf("%d",&n);
printf("2^%d is %d \n",n,2<<(n-1));
return 0;
}
@officialcjunior
officialcjunior / rotate_list.py
Created November 2, 2019 15:59
This is a python program which right-rotates and left-rotates a list n times.
def leftrotate(a,n):
for i in range (n):
first=a[0]
for i in range (0,len(a)-1):
a[i]=a[i+1]
a.pop()
a.append(first)
print(a)
@officialcjunior
officialcjunior / therank.py
Last active October 26, 2019 17:05
This is the solution for problem 1017A The Rank from codeforces.com, written in Python 3.
n=int(input())
S=[]
for i in range (n):
A=[int(i) for i in input().split()]
S.append(sum(A)) #S will now have the total marks of all students
if S[0]==max(S):
print("1")
exit() #We handle the case of Thomas being ranked 1 seperately.
thomas=S[0]
rank=1
@officialcjunior
officialcjunior / Pascals'_triangle.py
Last active October 28, 2019 16:07
This python program prints the Pascal's Triangle
for i in range(1, 9):
m = 1
for j in range(7, i-2, -1):
print(" ", end=' ')
for k in range(1, i+1):
print(m, end=' ')
m = m * 2
m = m // 2
for o in range (1,i):
m = m // 2
@officialcjunior
officialcjunior / prime.asm
Created October 8, 2019 08:09
Program to check whether a number is prime or not, written in x86 assembly code
BITS 32
extern printf
extern scanf
section .rodata
isprime: db "It's a prime number", 10, 0
notprime: db "It's not a prime number", 10, 0
input: db "%d", 0
output: db "%d", 10, 0
@officialcjunior
officialcjunior / fibonacci.asm
Created October 8, 2019 06:50
Program to print the n-th term in the fibonacci series, written in x86 assembly language
BITS 32
extern printf
extern scanf
section .rodata
output: db "The n-th term of the Fibnoacci series is %d", 10, 0
input: db "%d", 0
section .text
@officialcjunior
officialcjunior / factorial.asm
Last active December 9, 2019 11:24
Program to find the factorial of a number, written in assembly language
BITS 32
extern printf
extern scanf
section .rodata
fmt: db "%d", 0
output: db "factorial is %d",10,0
section .text
@officialcjunior
officialcjunior / collectionsdotnamed-tuple.py
Created October 2, 2019 06:08
Hackerrank solutions- python
import collections
N = int(input())
columns = input().split()
Student = collections.namedtuple('Student', columns)
sum = 0
for i in range(N):
line = input().split()
student = Student(*line)
sum += int(student.MARKS)