Skip to content

Instantly share code, notes, and snippets.

@gbajaj
gbajaj / cs
Created June 15, 2021 23:20
Strart
#region Using declarations
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
@gbajaj
gbajaj / CancelCheckInDoInBackground.java
Created July 9, 2019 19:35
DoInBackgroundCancel.java
DoInBackground(. . . ) {
//Doing some work
if (isCancelled()) {
// we are cancelled, no need to do any work now
. . .
// Did we override implement onCancelled() or onCancelled(Object)?
}
for (CurrentWork : ListOfWorks) {
if (isCancelled()) {
// we are cancelled, no need to do any work now
@gbajaj
gbajaj / rightIntegerComparison.java
Created July 8, 2019 20:42
Comparing Integers Right Way
public class Main {
public static void main(String[] args) {
Integer a = new Integer(10);
Integer b = new Integer(10);
if (a.equals(b)) {
System.out.println("true");
} else {
System.out.println("false");
}
}
@gbajaj
gbajaj / IntegerComparison.java
Created July 8, 2019 20:23
Compare Integers with Objects
public class Main {
public static void main(String[] args) {
Integer a = new Integer(10);
Integer b= new Integer(10);
if (a == b) {
System.out.println("true");
} else {
System.out.println("false");
}
}
@gbajaj
gbajaj / intCompare.java
Created July 8, 2019 20:16
Java Simple Integer Comparison
public class Main {
public static void main(String[] args) {
int a = 10;
int b = 10;
if (a == b) {
System.out.println("true");
} else {
System.out.println("false");
}
}
@gbajaj
gbajaj / gist:b9917610470d9cb75e66fc65d155cf60
Created July 8, 2019 20:15
Java Simple Integer Comparison
public class Main {
public static void main(String[] args) {
int a = 10;
int b = 10;
if (a == b) {
System.out.println("true");
} else {
System.out.println("false");
}
}
@gbajaj
gbajaj / hockeyapp-uploader.sh
Created July 30, 2017 08:19 — forked from adascal/hockeyapp-uploader.sh
HockeyApp's Command Line Uploader is a shell script to upload your IPA or APK files to HockeyApp for monitoring and distribution.
#!/bin/sh
# locations of various tools
CURL=curl
SERVER_ENDPOINT=https://rink.hockeyapp.net/api/2/
# Put your HockeyApp APP_TOKEN here. Find it in your HockeyApp account settings.
APP_TOKEN=""
package com.letsdecode.problems.recursion;
import java.util.ArrayList;
import java.util.List;
public class NQueeen {
int n;
boolean[][] a;
boolean truth[];
List<List<String>> list = new ArrayList<>();
package com.sjl.util;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import java.util.List;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
public class FragmentUtils {
/**
* @param frag
* The Fragment whose parent is to be found
* @param callbackInterface
* The interface class that the parent should implement
* @return The parent of frag that implements the callbackInterface or null