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 | |
echo Checking if required packages are installed... | |
rpm -q qemu-kvm python-virtinst libvirt | grep not | |
echo Done. | |
echo | |
echo Loaded kvm kernel modules: | |
lsmod | grep kvm_intel |
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/python | |
# Assume there is a 50 storey building and it has 4 lifts. You have to write a | |
# scheduler program for the lifts. All the 4 lifts will be controlled by | |
# single program and Waiting time for peoples waiting for lift should be | |
# minimum. | |
# | |
# Using the Nearest Car approach described at http://www.quora.com/Is-there-any-public-elevator-scheduling-algorithm-standard | |
# | |
# Some assumptions include direction of lift at top floor will always be down, | |
# and on ground floor it will be up. More assumptions obvious from the code. |
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
// Program to find the max sum in a subsequence in an array of numbers. | |
// | |
// Adapted from the O(n lg n) algorithm described by Jon Bentley in his famouos | |
// collection of programming columns - Programming Pearls. | |
// | |
// Author: Kartik Singhal | |
// Date: October 1, 2012 | |
#include <stdio.h> |
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
// Program to find the max sum in a subsequence in an array of numbers. | |
// | |
// Adapted from the linear time scanning algorithm described by Jon Bentley in | |
// his famouos collection of programming columns - Programming Pearls. | |
// | |
// Author: Kartik Singhal | |
// Date: October 1, 2012 | |
#include <stdio.h> |
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
" URL: http://vim.wikia.com/wiki/Example_vimrc | |
" Authors: http://vim.wikia.com/wiki/Vim_on_Freenode | |
" Description: A minimal, but feature rich, example .vimrc. If you are a | |
" newbie, basing your first .vimrc on this file is a good choice. | |
" If you're a more advanced user, building your own .vimrc based | |
" on this file is still a good idea. | |
"------------------------------------------------------------ | |
" Features {{{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
#!/bin/bash | |
sensors | |
aticonfig --odgt | |
answer="N" | |
if [ "$(whoami)" != "root" ]; then | |
echo -ne "\n\nDo you want to know hard disk temperature (requires sudo)? (y/N) " | |
read answer | |
if [ "$answer" == "y" ]; then |
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; | |
class DB; | |
class DM | |
{ | |
int metres; | |
int cms; | |
public: |
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
// file: string-func.cpp | |
// generates email IDs and stores them in a file | |
// author: Kartik Singhal | |
#include <iostream> | |
#include <cstring> | |
#include <fstream> | |
using namespace std; | |
int main() |
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 | |
baseurl="http://www.archive.org/download/MIT_Structure_of_Computer_Programs_1986/lec" | |
urlend="b_512kb.mp4" | |
log="log_b" | |
for i in {5..7} | |
do | |
nohup wget -c "${baseurl}$i${urlend}" > "${log}$i" & | |
done |
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
/* | |
* ieee754.c | |
* | |
* Program to check whether the compiler converts a given floating point number | |
* to the IEEE 754 specification. | |
* | |
* Original Authors: Mohammed Hashir and Ashwin Jacob | |
* This is a slightly modified and improved version by | |
* | |
* Kartik Singhal - B090566CS |