Skip to content

Instantly share code, notes, and snippets.

Avatar
😃
Working on something amazing...!!

Rahul Malhotra rahulmalhotra

😃
Working on something amazing...!!
View GitHub Profile
View errors and solutions.js
----------------------------------------------------------------------------------------------------------------------------
To add eslint :-
1. npm install -g eslint
2. add .eslintsrc to main project directory of react-native project
3. add this code to .eslintsrc -
{
"extends": "rallycoding"
}
4. npm install --save-dev eslint-config-rallycoding
5. In sublime text install package "Sublime Linter" and "sublimelinter-contrib-eslint"
@rahulmalhotra
rahulmalhotra / InsertionSortTurbo.cpp
Last active Nov 26, 2017
Insertion Sort Turbo C++ Code
View InsertionSortTurbo.cpp
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int size,arr[50],j=0,store;
cout<<"\n\nEnter the size of the Array";
cin>>size;
cout<<"\n\nEnter the array";
for(int i=1;i<=size;i++)
@rahulmalhotra
rahulmalhotra / InsertionSortCodeBlocks.cpp
Created Nov 26, 2017
Insertion Sort code compatible with Codeblocks IDE
View InsertionSortCodeBlocks.cpp
#include<iostream>
using namespace std;
int main()
{
int size,arr[50],j=0,store;
cout<<"\n\nEnter the size of the Array";
cin>>size;
cout<<"\n\nEnter the array";
for(int i=1;i<=size;i++)
{
@rahulmalhotra
rahulmalhotra / 1DArray.java
Created Nov 26, 2017
Program to create 1-D Array in Java
View 1DArray.java
public class array {
public static void main(String[] args) {
int months[]={1,2,3,4,5,6,7,8,9,10,11,12};
System.out.println("Months - ");
for(int i=0;i<12;i++)
System.out.println(months[i]);
}
}
@rahulmalhotra
rahulmalhotra / 1DArrayNew.java
Last active Nov 26, 2017
Program to make 1-D Array using new keyword in java
View 1DArrayNew.java
public class array {
public static void main(String[] args) {
String name[]=new String[3];
name[0]="Rahul ";
name[1]="Malhotra ";
name[2]="is a coder";
System.out.println(name[0]+name[1]+name[2]);
}
}
@rahulmalhotra
rahulmalhotra / 2DArray.java
Created Nov 26, 2017
Java program to create 2-D array using new keyword.
View 2DArray.java
public class array {
public static void main(String[] args) {
int m[][]=new int[2][2];
for(int i = 0;i<2;i++)
{
for(int j=0;j<2;j++)
{
m[i][j]=i+j+1;
System.out.println(m[i][j]);
}
@rahulmalhotra
rahulmalhotra / 2DArrayNew.java
Created Nov 26, 2017
Java program to make 2-D Array with different columns for each row.
View 2DArrayNew.java
public class array {
public static void main(String[] args) {
int m1[][]=new int[2][];
m1[0]=new int[1];
m1[1]=new int[2];
m1[0][0]=1;
//m1[0][1]=2;
m1[1][0]=3;
m1[1][1]=4;
System.out.println(m1[0][0]);
@rahulmalhotra
rahulmalhotra / 2DArrayNewDirect.java
Created Nov 26, 2017
Java program to make 2-D array without using new keyword
View 2DArrayNewDirect.java
public class array {
public static void main(String[] args) {
int m2[][]={{1},{1,2},{1,2,3}};
System.out.println(m2[0][0]);
//System.out.println(m2[0][1]);
//System.out.println(m2[0][2]);
System.out.println(m2[1][0]);
System.out.println(m2[1][1]);
//System.out.println(m2[1][2]);
System.out.println(m2[2][0]);
@rahulmalhotra
rahulmalhotra / pmdsamplecommandcustomrules.cls
Created Dec 16, 2017
PMD cmd sample command using custom rule
View pmdsamplecommandcustomrules.cls
pmd -d "C:\Users\Rahul Malhotra\Documents\My Lightning Org\src\classes\test.cls" -f html -R "F:\Program Files (x86)\pmd-bin-6.0.0\Ruleset\myrules.xml" -reportfile output.html
@rahulmalhotra
rahulmalhotra / pmdsamplecommanddefaultrules.cls
Created Dec 16, 2017
PMD sample command with default rules
View pmdsamplecommanddefaultrules.cls
pmd -d "C:\Users\Rahul Malhotra\Documents\My Lightning Org\src\classes" -f html -R category/apex/design.xml/ExcessiveParameterList -reportfile output.html