Skip to content

Instantly share code, notes, and snippets.

View proishan11's full-sized avatar
🏠

Ishan Singh proishan11

🏠
View GitHub Profile
def itob(i, n):
res = ''
while(i != 0):
res = str(i%2) + res
i = i//2
for i in range(n - len(res)):
res = '0' + res
return res
#include <iostream>
using namespace std;
bool isPrime(int x) {
if (x == 1) {
return false;
}
for (int d = 2; d * d <= x; d++) {
if (x % d == 0)
return false;
import alsaaudio
class AudioUtility:
def __init__(self):
self.m = alsaaudio.Mixer()
def increaseVolume(self):
vol = self.m.getvolume()
@proishan11
proishan11 / dictionary_script.sh
Created March 10, 2018 11:50
Script which install offline dictionary tool sdcv.
# Usage -$ bash dictionary_script.sh
sudo apt-get install sdcv
wget https://web.archive.org/web/20140917131745/http://abloz.com/huzheng/stardict-dic/dict.org/stardict-dictd_www.dict.org_gcide-2.4.2.tar.bz2
sudo mkdir -p /usr/share/stardict/dic/
sudo tar -xvjf stardict-dictd_www.dict.org_gcide-2.4.2.tar.bz2 -C /usr/share/stardict/dic
#include<iostream>
using namespace std;
#define cross '*'
int chess[8][8];
int count=0;
void initialize(){
for(int i=0; i<8; ++i)
for(int j=0; j<8; j++)