Skip to content

Instantly share code, notes, and snippets.

View hrshadhin's full-sized avatar
🏠
Working from home

H.R. Shadhin hrshadhin

🏠
Working from home
View GitHub Profile
@hrshadhin
hrshadhin / QuickSort.c
Created April 23, 2013 16:20
C code of Quick Sort Algorithm
#include<stdio.h>
void quicksort(int array[], int p, int r);
int partition(int array[], int p, int r);
int main()
{
int n;
printf("How many inputs do you want to enter?\n");
scanf("%d",&n);
int array[n];
@hrshadhin
hrshadhin / strlen.c
Created April 23, 2013 16:22
calculate String length
#include<stdio.h>
#include<string.h>
int main()
{
char string[100];
printf("Enetr your string that you want to caculate its length:\n");
gets(string);
int len=0,n=0;
while(string[n] != '\0')//length calculate
{
@hrshadhin
hrshadhin / UpperLowerCase.c
Created April 23, 2013 16:31
Convert String upper and lower case.
#include <stdio.h>
int main(void)
{
char str[80];
int i;
printf("Enter a string: ");
gets(str);
@hrshadhin
hrshadhin / Qgame.c
Created April 23, 2013 16:42
Questioning game..............
#include<stdio.h>
#include<string.h>
int mainmenu(void);
void correct(long int credit);
void worng(void);
void error(void);
void easy_level(void);
void medium_level(void);
void hard_level(void);
void checkans(char ch, char ch1);
@hrshadhin
hrshadhin / pid.c
Created April 23, 2013 16:46
Process id printer
#include<stdio.h>
int main(){
int pid,ppid;
pid=getpid();
ppid=getppid();
printf("This program process id[PID]:=%d\nAnd Parent process id[PPID]=%d\n",pid,ppid);
}
@hrshadhin
hrshadhin / ArraySum.c
Created April 23, 2013 16:49
Add numbers from two different arrays
#include<stdio.h>
void TAsum(int nam1, int nam2);//fuction prototype
int main()
{
int i;
int a1[]={2,3,4,5,6};
int a2[] = {9,8,7,5,2};
for(i=0;i<5;i++)
{
TAsum(a1[i],a2[i]);//call the function
@hrshadhin
hrshadhin / prime.py
Created June 8, 2014 18:03
Prime number generate in python
#!/usr/bin/python3
'''
Prime number generator
'''
def isPrime(n):
for num in range(1,n):
if num%2 !=0:
print(num)
@hrshadhin
hrshadhin / inheritance.js
Created October 27, 2016 17:55
JavaScript Learning code about inheritance
"use stict"
/*Inheritance
* Examples Practice
*/
//extend function
function extend(Child,Parent){
Child.prototype = new Parent();
Child.prototype.constructor = Child;
}
//animal Constructor
@hrshadhin
hrshadhin / love-me.py
Created November 23, 2016 02:22
A funny python script that about love and me
from world import me, you
from my.consciousness import I,your
from feelings import *
always = True
if you in (depressed, sadness, resignation):
print 'My Sweetheart'
if feel(you) is lonely or feel(you) is neglected:
talk_me(this)
while always:
@hrshadhin
hrshadhin / django-uwsgi.ini
Created March 29, 2017 20:06
django app deploy with uwsgi
[uwsgi]
chdir=path of project
home = path of virtual env
module=project name.wsgi
master=True
process = 5
pidfile=/tmp/whatever.pid
socket= /tmp/whatever.sock
vacuum=True
max-requests=5000