Skip to content

Instantly share code, notes, and snippets.

View smamran's full-sized avatar
🎯
Focusing

S. M. AMRAN smamran

🎯
Focusing
View GitHub Profile
@smamran
smamran / AbstractClassMethod.java
Created October 7, 2015 12:36
Abstract Class Example
package slidenerd.javaoop;
/**
* Created by Microsoft on 10/7/2015.
*/
public class AbstractClassMethod {
public static void main(String[] args) {
Human human = new Human();
human.printInfo();
@smamran
smamran / AbstractMethodImplementation.java
Created October 7, 2015 12:53
Abstract Class Method Implementation
package slidenerd.javaoop;
/**
* Created by Microsoft on 10/7/2015.
*/
public class AbstractMethodImplementation {
public static void main(String[] args) {
AbstractText abstractText = new AbstractText();
abstractText.printSubInfo(); // SubClass info
abstractText.printSuperInfo(); // SubClass info
@smamran
smamran / CppLambda.cc
Created November 10, 2015 06:40
CplusPlus Lambda
// Utilities library
#include <cstdlib> // General purpose utilities: program control, dynamic memory allocation, random numbers, sort and search
#include <csignal> // Functions and macro constants for signal management
#include <csetjmp> // Macro (and function) that saves (and jumps) to an execution context
#include <cstdarg> // Handling of variable length argument lists
#include <typeinfo> // Runtime type information utilities
#include <typeindex> // (since C++11) std::type_index
#include <type_traits> // (since C++11) Compile-time type information
#include <bitset> // std::bitset class template
#include <functional> // Function objects, designed for use with the standard algorithms
@smamran
smamran / LinuxShell.md
Last active March 19, 2016 14:02
Linux Shell Run Root Directory files from current directory

c9.io Command

  sudo cp FileWalker.java /                                        ## copy FileWalker.java file to /(root) directory.
  (cd ..; cd .. ; cd .. ; javac FileWalker.java; java FileWalker)  ## it's a subshell , which executes a list of commands from current dir
  cp libc.h /home/ubuntu/workspace/                                ## compies libc.h file to c9.io workspace
  hostname -I                                                      ## get ip address of current machine
@smamran
smamran / g++ commands.sh
Created November 11, 2015 08:34
g++ commands
g++ -Wl,--no-as-needed -std=c++11 -pthread threadcpp.cc ## For compiling g++ code with <thread> header.
@smamran
smamran / Ubuntu Configure.sh
Last active November 11, 2015 12:00
Linux Configuration
################# Mobatake openssh server install ##########
Try un-installing and then installing openssh-server:
sudo apt-get remove openssh-client openssh-server
and then
sudo apt-get install openssh-client openssh-server
This worked for me. If you still can not connect, try
#############################################################
@smamran
smamran / 2d array pointer.c
Created November 12, 2015 05:01
Pointer Concept
// Utilities library
#include <cstdlib> // General purpose utilities: program control, dynamic memory allocation, random numbers, sort and search
#include <csignal> // Functions and macro constants for signal management
#include <csetjmp> // Macro (and function) that saves (and jumps) to an execution context
#include <cstdarg> // Handling of variable length argument lists
#include <typeinfo> // Runtime type information utilities
#include <typeindex> // (since C++11) std::type_index
#include <type_traits> // (since C++11) Compile-time type information
#include <bitset> // std::bitset class template
#include <functional> // Function objects, designed for use with the standard algorithms
@smamran
smamran / Valgrind Install.sh
Created November 15, 2015 04:32
Valgrind Memory Leak Checker in C
########## Install Valgrind ##################
wget http://www.valgrind.org/downloads/valgrind-3.11.0.tar.bz2
bzip2 -d valgrind-3.11.0.tar.bz2
tar -xf valgrind-3.11.0.tar
cd valgrind-3.11.0
./configure
sudo make
sudo make install
@smamran
smamran / HashMap.c
Created November 15, 2015 09:09
C HashMap
#include <assert.h> // Conditionally compiled macro that compares its argument to zero
#include <complex.h> // (since C99) Complex number arithmetic
#include <ctype.h> // Functions to determine the type contained in character data
#include <errno.h> // Macros reporting error conditions
#include <fenv.h> // (since C99) Floating-point environment
#include <float.h> // Limits of float types
#include <inttypes.h>// (since C99) Format conversion of integer types
#include <iso646.h> // (since C95) Alternative operator spellings
#include <limits.h> // Sizes of basic types
#include <locale.h> // Localization utilities
@smamran
smamran / JNI Steps
Last active November 16, 2015 12:03
JNI MinGW Tutorial x64 Windows
########## GNU MinGW JNI Tutorial Windows x64 ############
##. Copy jni.h jni_md.h to MinGW include Directory
--- JniApp.java ----
public class JniApp{
public native int factorial(int number);