Skip to content

Instantly share code, notes, and snippets.

Jacob Abraham jacobabrahamb4

Block or report user

Report or block jacobabrahamb4

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jacobabrahamb4
jacobabrahamb4 / push.sh
Created Jul 17, 2018
push project to android device
View push.sh
#!/bin/sh
if [ $# -gt 0 ]; then
adb root
sleep 1
adb remount
sleep 1
for i in "$@"
do
adb shell sync
adb shell rm -rf /"$i"
@jacobabrahamb4
jacobabrahamb4 / bdiff.py
Last active Oct 9, 2019
Display diff between two commits.
View bdiff.py
#!/usr/bin/env python
import sys, subprocess, os
TOOLS = ['bcompare', 'meld']
HEAD = 'HEAD'
TMP = '/tmp/'
execute = lambda command: subprocess.check_output(command)
which = lambda tool: execute(['which', tool]).strip()
@jacobabrahamb4
jacobabrahamb4 / stack_using_linked_lists.c
Created Apr 18, 2013
stack using linked lists, will be edited later.
View stack_using_linked_lists.c
//http://www.zentut.com/c-tutorial/c-stack-using-pointers/
#include <stdio.h>
#include <stdlib.h>
typedef struct node{
int data;
struct node* next;
} node;
@jacobabrahamb4
jacobabrahamb4 / single_linked_list.c
Created Apr 18, 2013
single linked list, only functions are included, will be implemented later.....
View single_linked_list.c
//http://www.zentut.com/c-tutorial/c-linked-list/
#include <stdio.h>
#include <stdlib.h>
typedef struct node{
int data;
node* next=NULL;
} node;
@jacobabrahamb4
jacobabrahamb4 / abs_float.c
Created Apr 14, 2013
absolute value of float
View abs_float.c
#include<stdio.h>
int main()
{
float x;
printf("Enter the float number:\n");
scanf("%f", &x);
// copy and re-interpret as 32 bit integer
int casted_to_int = *(int*)&x;// float pointer is converted to an integer pointer and dereferenced.
@jacobabrahamb4
jacobabrahamb4 / pipelining.txt
Last active Dec 16, 2015
Pipelining concept in computer architecture
View pipelining.txt
//http://discuss.itacumens.com/index.php?topic=7635.0
Pipelining concept in computer architecture
In this Module, we have three lectures,
1. Introduction to Pipeline Processor
2. Performance Issues
3. Branching
@jacobabrahamb4
jacobabrahamb4 / bitwise.c
Created Apr 13, 2013
using bitwise operators....
View bitwise.c
//http://www.catonmat.net/blog/low-level-bit-hacks-you-absolutely-must-know/
#include <stdio.h>
void check_even_odd(int);
void check_nth_bit_is_set(int , int);
int set_the_nth_bit(int,int);
int unset_the_nth_bit(int,int);
int toggle_nth_bit(int, int);
int turn_off_the_righmost_one(int);
@jacobabrahamb4
jacobabrahamb4 / debugging_macros.c
Last active Dec 16, 2015
using some built in macros in c for debugging purpose
View debugging_macros.c
// its documented here in this link http://www.delorie.com/gnu/docs/gcc/cpp_21.html
#include <stdio.h>
#include <stdlib.h>
#define PRINTINFO(message) print_info(__FILE__, __LINE__, __DATE__, __TIME__, message)
void print_info(const char* file,int line, const char* date, const char* time, const char* message)
{
printf("FILE is : %s\n ", file);
View convert_to_uppercase.c
// find more explanations here
// https://www.securecoding.cert.org/confluence/display/seccode/STR30-C.+Do+not+attempt+to+modify+string+literals
#include <stdio.h>
#include <stdlib.h>
int main()
{
char *strptr = NULL, *copy = NULL;
strptr = "Jacob Abraham"; // this will be stored in a read only location hence cannot be modified.
View function_pointers.c
#include <stdio.h>
#include <stdlib.h>
typedef int* intPtr;
typedef float (*fPtr) (float, float);
float plus(float a, float b){return a+b;}
float minus(float a, float b){return a-b;}
float multiply(float a, float b){return a*b;}
float divide(float a, float b){return a/b;}
You can’t perform that action at this time.