Skip to content

Instantly share code, notes, and snippets.

View pethaniakshay's full-sized avatar
🎯
Focusing

Akshay Pethani pethaniakshay

🎯
Focusing
View GitHub Profile
@pethaniakshay
pethaniakshay / LinkedList.java
Created May 20, 2017 10:38
Java Implementation of the Linked List Data Structure.
import java.util.Scanner;
public class LinkedList {
static Node First =new Node();
static Node current,last;
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
@pethaniakshay
pethaniakshay / Animation.html
Created May 26, 2017 08:04
Best CSS3 Animation Demo [Super Mario Animation In HTML CSS]
<!-----------------------------------------------
Author: Qaidjohar
Date Created: Nov 7 2016
Logical Comment: Leisure Activity
------------------------------------------------>
<html>
<head>
<title>Mario</title>
<style type="text/css">
<!DOCTYPE html>
<html lang="de">
<head>
<title>Verticlly Center Text</title>
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
@pethaniakshay
pethaniakshay / CenterTextInDiv.html
Last active May 28, 2017 07:43
HTML/CSS code to vertically+horizontally centre the text in div tag. https://www.codepuran.com/web-designing/vertically-horizontally-align-text-div/
<!DOCTYPE html>
<html lang="de">
<head>
<title>Verticlly Center Text</title>
<style>
.centre-text {
display: table;
height: 100px;
width: 100%;
text-align: center;
@pethaniakshay
pethaniakshay / LabeledForLoop.java
Last active May 30, 2017 16:01
Example of Labeled For Loop in Java
public class LabeledForLoop{
public static void main(String args[]){
outer_loop:
for(int i=0 ; i<5 ; i++){
inner_loop:
for(int j=0 ; j<5 ; j++){
if(i==2 || j ==4){
break outer_loop;
@pethaniakshay
pethaniakshay / AnonymousObject.java
Created May 31, 2017 05:58
Example of Anonymous Object In Java
public class AnonymousObject{
public static void main(String args[]){
System.out.println("Addtion: " + new Calc().add(5,9));
System.out.println("Multiplication: " + new Calc().mul(3,5));
}
}
class Calc{
public int add(int n1, int n2){
@pethaniakshay
pethaniakshay / FXMLDocument.fxml
Created June 1, 2017 05:17
Splash Screen in JavaFX using FXML
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<AnchorPane fx:id="ap" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1" fx:controller="splashscreen.FXMLDocumentController">
<children>
<ImageView fitHeight="300.0" fitWidth="442.0" layoutX="116.0" layoutY="50.0" pickOnBounds="true" preserveRatio="true">
<image>
@pethaniakshay
pethaniakshay / FullPageBackGroundImage.html
Created June 1, 2017 07:20
Full Page Image - Full Size Back Ground Image In HTML CSS
<!DOCTYPE html>
<html>
<head>
<style>
body, html {
height: 100%;
margin: 0;
}
.bg-pic {
@pethaniakshay
pethaniakshay / FXML2.fxml
Created June 8, 2017 19:43
Switching between Scenes (Screens) in JavaFx using the FXML
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.AnchorPane?>
<AnchorPane id="AnchorPane" prefHeight="237.0" prefWidth="448.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8.0.60" fx:controller="FXMLDocumentController">
<children>
<Button fx:id="btn2" layoutX="159.0" layoutY="126.0" mnemonicParsing="false" onAction="#handleButtonAction" text="Click to go to scene 1" />
<Label layoutX="179.0" layoutY="71.0" text="You re in scene 2" />
/*
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
For example, given n = 3, a solution set is:
"((()))", "(()())", "(())()", "()(())", "()()()"
*/
public class Solution {