Skip to content

Instantly share code, notes, and snippets.

View nijjwal's full-sized avatar
🎯
Focusing - Don't disturb

Nijjwal nijjwal

🎯
Focusing - Don't disturb
View GitHub Profile
@nijjwal
nijjwal / Functions.java
Last active August 29, 2015 14:13
Functions.java
import java.util.ArrayList;
public class Functions {
/**
* Display invalid numbers in a given array that are not the multiples of the key parameter.
* @param key Enter a number whose multiple you want to find
* @param array Enter the array which you want to check for invalid numbers
* @return
@nijjwal
nijjwal / Main.java
Last active August 29, 2015 14:13
Main.java
import java.util.ArrayList;
public class Main extends Functions{
public static void main(String[] args) {
Functions test = new Functions();
//Create an array to test
int[] array = {8,16,24,5,3,2};
int key = 8;
ArrayList<Integer> results = test.Multiplesofanumber(key, array);
@nijjwal
nijjwal / functions.js
Last active December 1, 2023 10:28
For this challenge you will determine the Run Length Encoding of a string.
<script>
/*
Have the function RunLength(str) take the str parameter being passed
and return a compressed version of the string using the Run-length
encoding algorithm. This algorithm works by taking the occurrence of
each repeating character and outputting that number along with a single
character of the repeating sequence. For example: "wwwggopp" would return
3w2g1o2p. The string will not contain any numbers, punctuation, or symbols.
*/
@nijjwal
nijjwal / java-tutorial-for-beginners.java
Last active June 4, 2024 10:51
Java Tutorial for Beginners
This is my Java note from caveofprogramming.com by John.
This is not a program.
All credit goes to John.
/*
|----------------------------------------
|Ten tips to make you a better programmer.
|----------------------------------------
*/
10. Learn to touch type.
9. Name variables and subroutines descriptively
@nijjwal
nijjwal / springmvc.java
Created January 20, 2015 08:04
This is my note for spring mvc tutorial from gontuseries.
/**
|---------------------------------------------------------------
|Chapter 3. Installation and setup using Eclipse
|---------------------------------------------------------------
*/
1. Rt click > New > Other > Web > Dynamic Web Project
-Project name: FirstSpringMVCProject
-Next
-Next
@nijjwal
nijjwal / collection-java-tutorial.java
Last active March 24, 2024 14:48
collection-java-tutorial.java
//This is my note for Java Collection Framework course taught by John.
//Original credit: John from caveofprogramming.com
//All of his videos can be found in youtube.com
/**---------------------------------
| 1. ArrayList
|
*/---------------------------------
1.
-ArrayList class implements the class that is expandable.
@nijjwal
nijjwal / javafx-tutorial.java
Last active August 29, 2015 14:14
javafx-tutorial.java
/**
|------------------------------------
|1. Introductiona and Installation
|------------------------------------
*/
1. A lot of people use NetBeans with JavaFX.
2. You will need Java 7 for this. You will need JDK 7 or later.
@nijjwal
nijjwal / common-errors.java
Created January 28, 2015 05:52
Java Common Errors
1. Null Pointer Exception.
- If you are trying to access an object that does not exist.
For example, accesing an object whose pkid id 1 , but that has already been deleted will
result in Null Pointer Exception.
@nijjwal
nijjwal / sql-vulnerable-code-pdo.php
Last active May 25, 2020 02:20
PHP - SQL Injection - 1
<?php
//This class helps to connect to the
class Connection{
public function connect()
{
return new PDO('mysql:host=localhost; dbname=sqlinjection2','root','root');
}
}
@nijjwal
nijjwal / sql-vulnerable-code-pdo.php
Last active May 25, 2020 02:20
PHP - SQL Injection - 1
<?php
require 'pdo.php';
//1. Create an instance of connection
$pdo_obj = new Connection();
//2. Connect to the server + db
try