Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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;