Skip to content

Instantly share code, notes, and snippets.

View mashcom's full-sized avatar
💭
Working

Blessing Mashcom Mashoko mashcom

💭
Working
View GitHub Profile
@mashcom
mashcom / arrays.c
Created June 16, 2014 11:53
basic array in c
#import <stdio.h>
int main(int argc, char * argv[]){
int areas[]={10,67,7,90,89};
printf("the size of ints id %ld",sizeof(int));
printf("the first character of array is %d",areas[0]);
return 0;
};
@mashcom
mashcom / files.py
Created June 16, 2014 11:50
files io basic
#read file
# calculate trajetory
# @author: Mashoko Blessing
# @ http://www.facebook.com/blessing.mashcom
# @mashcom digimedia http://www.hookd-up.com
import os
def isFileAvailable(myfile):
if(os.path.isfile(myfile)):
@mashcom
mashcom / factorial.py
Created June 16, 2014 11:36
calculate factorials in python.
# calculate factorial
# @author: Mashoko Blessing
# @http://www.facebook.com/blessing.mashcom
# @mashcom digimedia http://www.hookd-up.com
#email: bmashcom@hotmail.com
def factorial(x):
if(x==0):
return 1
else:
@mashcom
mashcom / trajectory.py
Last active August 29, 2015 14:02
this is beginners demo of how to calculate trajectory using python. this code is not validated and there are no exception catching mechanisms, it for learning purposes
# calculate trajetory
# @author: Mashoko Blessing
# @ http://www.facebook.com/blessing.mashcom
# @mashcom digimedia http://www.hookd-up.com
from math import sin,cos,pi
def calculateTraf(angle, velocity ):
#defining gravity