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<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++) |
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
# 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 |
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 alsaaudio | |
class AudioUtility: | |
def __init__(self): | |
self.m = alsaaudio.Mixer() | |
def increaseVolume(self): | |
vol = self.m.getvolume() |
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 <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; |
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 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 |