Skip to content

Instantly share code, notes, and snippets.

View BetelGeuseee's full-sized avatar
🐢

Shirshak Upadhayay BetelGeuseee

🐢
View GitHub Profile
@BetelGeuseee
BetelGeuseee / CalculatorLabWork.cs
Created December 3, 2020 10:59
LabCalculator in C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
@BetelGeuseee
BetelGeuseee / dfs.java
Created September 8, 2020 12:23
Depth First Search in Graph using JAVA (modified code from gfg)
package GraphProblems;
import java.util.Iterator;
import java.util.LinkedList;
class Graph{
private int vertices;
private LinkedList<Integer>[] adjacent;
Graph(int v){
this.vertices=v;
adjacent=new LinkedList[v]; //makes vertices array
for(int i=0;i<v;i++){
@BetelGeuseee
BetelGeuseee / FiboRecursive.java
Created August 23, 2020 11:08
Fibonacci series using recursion in JAVA
import java.util.Scanner;
public class FibonacciRecursion {
static int first=0,second=1,next=0;
static void generateFibo(int range){
if(range>0){
next=first+second;
first=second;
second=next;
System.out.print(next+" ");
@BetelGeuseee
BetelGeuseee / BitmapConversison.java
Created June 14, 2020 02:12
Adding image from gallery and changing it into byte array and Bitmap(Vice versa)
//opening gallery and choosing image ,,,Here gallery request code final string of any number more than zero(3 digit)
Intent intent = new Intent();
intent.setType("image/*"); //this is done because it allows to select any kind of image
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent,"Pick Image"),GALLERY_REQUEST_CODE);
//this will be called every time you choose image from the gallery
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
//checking request code ==gallery code or not? and checking we have valid image data or not
@BetelGeuseee
BetelGeuseee / database.java
Created May 25, 2020 12:39
some databse operations on android
package com.example.databaseproject;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
public class ShirshakDatabaseAdapter {
@BetelGeuseee
BetelGeuseee / SharedPreferences.java
Created May 24, 2020 03:37
Shared Preferences in Android
//There are two Activity ..First one takes the username and password from the user and saves in a XML file named "MyData"
// The next Activity loads the username and password in the textview in that activity
//ACTIVTY ONEEEEEEEEEEEEEEEEEEEEEE
package com.example.sharedpreferenceproject;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
@BetelGeuseee
BetelGeuseee / navigation.java
Created May 23, 2020 12:41
Navigation Drawer in android using Base Adapter list view
package com.example.fragmenttwo;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.drawerlayout.widget.DrawerLayout;
@BetelGeuseee
BetelGeuseee / BinaryTree.java
Created May 21, 2020 16:50
Binary tree traversal and insertion
package TreeProblems;
public class BinaryTree {
static class Node{
int value;
Node left,right;
Node(int value){
this.value=value;
left=null;
right=null;
@BetelGeuseee
BetelGeuseee / ListViewImage.java
Last active March 7, 2021 14:22
ListView images on android using custom ArrayAdapter
package com.example.listviewimage;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Context;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@BetelGeuseee
BetelGeuseee / linearlayoutxml.java
Created May 9, 2020 05:31
Android Linear Layout XML description in JAVA code
package com.example.rough;
import android.app.Activity;
import android.os.Bundle;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.Nullable;