Skip to content

Instantly share code, notes, and snippets.

View Zulqurnain's full-sized avatar
🎯
Focusing

Zulqurnain Haider Zulqurnain

🎯
Focusing
  • Rave Business Systems LLC
  • Lahore, Pakistan
View GitHub Profile
@Zulqurnain
Zulqurnain / Java: Randomize Numbers
Last active January 3, 2016 09:39
Java Program to print the Random Number between given starting and ending value.
package basics;
import java.util.*;
import javax.swing.JOptionPane;
class Basics { // done by Zulqurnain jutt
public static void main(String[] args) {
String s;
int si,ei,numi;
s=JOptionPane.showInputDialog(null, "\t::Starting Range::\t");
@Zulqurnain
Zulqurnain / Java:Paragraph details
Last active April 10, 2016 18:56
Java code to take paragraph as an input from user and do the following: 1.count total number of character 2.count total number of spaces 3.count total number of string (are)
package basics;
import java.util.*;
class Basics{ // by Zulqurnain jutt
public static void main(String argv[]) {
String s;
Scanner sc=new Scanner(System.in);
System.out.print("::Start Entering Paragraph from Here::\n\t"); s=sc.nextLine();
char[] c=s.toCharArray();
System.out.print("\nTotal Character :=:"+c.length+"\nTotal Spaces :=:"+ (s.length()-s.replace(" ", "").toCharArray().length));
@Zulqurnain
Zulqurnain / C++: Paragraph details
Created January 17, 2014 12:46
C++ code to take paragraph as an input from user and do the following: 1.count total number of character 2.count total number of spaces 3.count total number of string (are)
#include<iostream>
using namespace std;
int main(void){ // by zulqurnain jutt
char arr[200]; // you can use pointer for longer strings
cout<<"\n::Start Entering Your Paragraph Now::\n\t";
cin.getline(arr,200,'\n');
int i=0,j=0,NoofChars=0,Noofspaces=0,NoofStrings=0;
for(;arr[i]!=0;i++,NoofChars++){
if(arr[i]==' '){
@Zulqurnain
Zulqurnain / C: Paragraph Details
Created January 20, 2014 20:47
C code to take paragraph as an input from user and do the following: 1.count total number of character 2.count total number of spaces 3.count total number of string (are)
#include<stdio.h>
#include<conio.h>
void main(void){ // by zulqurnain jutt
char* arr=new char[200]; // you can use pointer for longer strings
printf("\n::Start Entering Your Paragraph Now::\n\t");
int i=0,j=0,NoofChars=0,Noofspaces=0,NoofStrings=0;
while(arr[i]=getch()){
if(arr[i]!=13){
// escape sequence \n can't be used as '\n' in this case so use its Ascii 13
@Zulqurnain
Zulqurnain / [Assembly] Finding Largest Number In Array
Created April 6, 2014 19:59
[Assembly] Write a procedure in Assembly Language that finds a largest number in an array and store it in AX, assume that array offset is in BX and array length is in CX.
.model small ;preprocessors
data_seg segment 'data'
vargaye dw 1,0,5,8,3
data_seg ends
stack_seg segment 'stack'
db 100h dup(?)
@Zulqurnain
Zulqurnain / C++ : BinaryTree.h
Created May 31, 2014 12:27
BinaryTree.h template type class containing functionalities of binary tree
#include <iostream>
#include <conio.h>
using namespace std;
/*******************************************************************************************************/
/*******************************************************************************************************/
/******************************** Node of Template Type ********************************************/
/*******************************************************************************************************/
/*******************************************************************************************************/
template<typename T>
@Zulqurnain
Zulqurnain / C++: Find matrix is Symmetricor not
Created August 5, 2014 19:58
C++ program to find that given N*M matrix is symmatric or anti symmetric.
#include <stdio.h>
#include<iostream>
#include <Windows.h>
using namespace std;
int main(){
int rows, col, i, j;
cout << "Enter Number of Rows of Matrix :=:"; cin >> rows; cout << "\n";
cout << "Enter Number of coloumns of Matrix :=:"; cin >> col; cout << "\n";
package rx.android.observables;
import rx.Observable;
import rx.Observable.OnSubscribe;
import rx.Subscriber;
import rx.android.subscriptions.AndroidSubscriptions;
import rx.functions.Action0;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@Zulqurnain
Zulqurnain / RxFirebase.java
Created November 14, 2016 12:07 — forked from TinasheMzondiwa/RxFirebase.java
RxFirebase implementation. Fork from https://gist.github.com/gsoltis/86210e3259dcc6998801 with my improvements.
import com.google.android.gms.tasks.Task;
import com.google.firebase.database.ChildEventListener;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.Query;
import com.google.firebase.database.ValueEventListener;
import rx.Observable;
import rx.Subscriber;
@Zulqurnain
Zulqurnain / YoutubeUtils.java
Last active March 19, 2018 00:25
Play Youtube Video Using WebView
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
/**
* Created by Zulqurnain on 19/03/2018.
*/
public class YoutubeUtils {