This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALSA lib confmisc.c:768:(parse_card) cannot find card '0' | |
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory | |
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings | |
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory | |
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name | |
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory | |
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory | |
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM default | |
Jan 01 07:09 : alsa_output: Failed to open "Pi Speakers" [alsa]: Failed to open ALSA device "default": No such file or directory | |
Jan 01 07:09 : output: Failed to open audio output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Author: Sayantan Khan | |
Date: 8th September, 2014 | |
""" | |
import matplotlib.pyplot as plt | |
import random |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Install the application imagemagick before using this script | |
TARGET_DIR=$1 # Unzip the file and the folder is the first argument | |
mkdir target # A temporary directory to hold the images | |
find "$TARGET_DIR" -name "*.jpg" -print0 | xargs -0 cp -t ./target | |
convert ./target/*.jpg output.pdf # output.pdf is the name of the output file | |
rm -r target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def check_bit4(inp): | |
if inp & 16 > 0: # 16 is just 0b1000 | |
return "on" | |
else: | |
return "off" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Temp { | |
def a(r: List[Int]): List[Int] = { | |
r map ((x: Int) => x*2) | |
} | |
def a(r: List[String]): List[String] = { | |
r map ((x: String) => x*2) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
// All important code here | |
// Following the code, there are questions related to the code | |
// which you need to solve. | |
float power(float x, int n) { // Calculates the float x raised to n | |
if(n>=0) { | |
float result = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.util.Random | |
object HashCollide { | |
def gen_random_lists(size: Int, upper: Int) = { | |
val s = Random.nextInt(size) | |
(1 to s).toList map (_ => Random.nextInt(upper)) | |
} | |
def gen_list_of_list(size1: Int, size2: Int = 10, upper: Int = 20) = { | |
((1 to size1).toList map (_ => gen_random_lists(size2, upper))).distinct |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
def sanitize(dens, amount): | |
return tuple(filter(lambda x: x<=amount, dens)) | |
def memoize(func): | |
cache = {} | |
def inner(dens, amount): | |
dens = sanitize(dens, amount) | |
if not (dens, amount) in cache: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
array=("a" "b" "c" "d" "e") | |
length=${#array[@]} | |
for i in $(seq 0 $(($length - 2))); | |
do | |
for j in $(seq $(($i + 1)) $(($length - 1))); | |
do | |
echo ${array[i]} ${array[j]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .latexmkrc starts | |
$pdf_mode = 1; | |
$pdflatex .= ' && (cp "%D" "%R.pdf"; echo Output file copied from "%D" to "%R.pdf" in current directory)'; | |
$out_dir = 'build'; | |
# .latexmkrc ends |