Skip to content

Instantly share code, notes, and snippets.

View biodunalfet's full-sized avatar

Hamza Fetuga biodunalfet

View GitHub Profile
import java.util.Scanner;
import java.io.*;
import java.lang.Math;
public class quest3 {
static double Vm;
static double F;
static int N = 1000;
import java.util.Scanner;
import java.io.*;
public class quest7 {
public static void main(String[] args){
print("Enter path to existing source file e.g myfolder/file1.txt : ");
Scanner input = new Scanner(System.in);
import java.io.File;
import java.util.Scanner;
import java.util.ArrayList;
public class quest1 {
public static void main(String[] args){
ArrayList<String> words = new ArrayList<>();
try {
System.out.print("Enter the file name with extension e.g. file.txt: ");
@biodunalfet
biodunalfet / gist:762c732d408d2773665308081a21ec05
Created December 22, 2016 23:57 — forked from clintel/gist:1155906
Fenced code in bullet lists with GitHub-flavoured MarkDown??

Fenced code blocks inside ordered and unordered lists

  1. This is a numbered list.

  2. I'm going to include a fenced code block as part of this bullet:

    Code
    More Code
    
@biodunalfet
biodunalfet / CardFragment.java
Created December 11, 2016 08:17
See the shareButton part. Line 135.
package com.example.sep.loveartlearnart;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
@biodunalfet
biodunalfet / recycle_items.xml
Created December 7, 2016 04:13
Line 30 I added android:clickable = "true"
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
card_view:cardCornerRadius="4dp">
@biodunalfet
biodunalfet / build.gradle
Created December 7, 2016 04:13
Line 9 Necessary for adding the Parceler library
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
// NOTE: Do not place your application dependencies here; they belong
@biodunalfet
biodunalfet / build.gradle
Created December 7, 2016 04:11
Lines 2, 34 and 35 I added the Parceler library to the project This https://guides.codepath.com/android/Using-Parceler should be helpful in explaining what Parcelables are and why I used the Parceler library.
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
android {
compileSdkVersion 25
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.example.sep.loveartlearnart"
minSdkVersion 15
targetSdkVersion 25
@biodunalfet
biodunalfet / ArtModel.java
Created December 7, 2016 04:09
I added the @parcel annotation to it to make it Parcelable. I also added an empty constructor. It is required for Parceler to work
package com.example.sep.loveartlearnart;
import org.parceler.Parcel;
/**
* Created by Eni on 2016-12-04.
*/
@Parcel
public class ArtModel {
@biodunalfet
biodunalfet / FullScreenImage.java
Created December 7, 2016 04:07
I got the ArtModel object sent from the previous activity and displayed it basically
package com.example.sep.loveartlearnart;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ImageView;
import android.widget.Toast;
import org.parceler.Parcels;