Skip to content

Instantly share code, notes, and snippets.

View shah-smit's full-sized avatar
🎯
Focusing

Smit Shah shah-smit

🎯
Focusing
View GitHub Profile
@shah-smit
shah-smit / Readme.md
Last active April 26, 2017 16:24
String (String literal, StringBuffer, StringBuilder

String

== references to memory location, i.e if the both the objects share the same memory
.equals(...) references to the value of the object i.e if the both the objects has the exactly the same value.

Case 1: Considered String a liternal IMMUTABLE

Example: String name = "Smit"; In the memory | name || Smit | So whenever a new literal is created, Java(JVM) will go a check for its existance in the mrmory and it there is no, it will create new. name = "Smit Shah"; In the memory |name || Smit| | name || Smit Shah| so everytime program makes changes to the String variable, it will create a new instance in the memory and it will cause HEAP size to increase

@shah-smit
shah-smit / output.txt
Last active April 26, 2017 02:41
Pass By Value and Pass By Reference JAVA
1
2
11
12
12
10
A
@shah-smit
shah-smit / angular2-fullcalendar.md
Last active March 7, 2017 03:07
Getting Started with Angular 2 Full Calendar.

##1: NPM Install##

npm install fullcalendar

npm i angular2-fullcalendar

npm install jquery

npm install moment

I just started using this plugin today so I'm not an expert but here is what I did to make it work.

  1. npm install angular2-fullcalendar --save
  2. Create a new component: ionic g component full-calendar
  3. In full-calendar.html I inserted:
<angular2-fullcalendar [options]="calendarOptions"></angular2-fullcalendar>
@shah-smit
shah-smit / filey.java
Created February 17, 2017 11:39
File Reader, its own in JAVA
import java.io.*;
public class filey
{
public static void bling(String s)throws Exception
{
BufferedReader inone = new BufferedReader(new FileReader(s));
int t = inone.read();
while(t != -1)
{
[
{
"productId": 1,
"productName": "Leaf Rake #1",
"productCode": "GDN-0011",
"releaseDate": "March 19, 2016",
"description": "Leaf rake with 48-inch wooden handle.",
"price": 19.95,
"starRating": 3.2,
"imageUrl": "http://openclipart.org/image/300px/svg_to_png/26215/Anonymous_Leaf_Rake.png"
@shah-smit
shah-smit / genericArrayPrint.java
Created December 18, 2016 03:30
Generic Array Print
class Printer
{
//Write your code here
<T> void printArray(T[] anyType)
{
for(int i = 0; i<anyType.length; i++)
{
System.out.println(anyType[i]);
}
}
@shah-smit
shah-smit / TabbedFrame.Java
Created September 27, 2016 13:19
Tabbed Panel Java Application
import javax.swing.*;
public class TabbedFrame {
public static void main(String[] args) {
// TODO Auto-generated method stub
JFrame frame = new JFrame("ButtonClickPanel Demo");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JTabbedPane tp = new JTabbedPane();
@shah-smit
shah-smit / SimpleFrame.java
Created September 27, 2016 12:10
A simple GUI with one panel contained in a frame
import java.awt.*;
import javax.swing.*;
public class SimpleFrame {
public static void main(String[] args) {
// TODO Auto-generated method stub
JFrame frame = new JFrame("A simple Frame");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
@shah-smit
shah-smit / Readme.md
Last active August 29, 2016 02:49
University Answer Format

#Answer Writing Format

###Never use First Person writings i.e I or We or In my opinion or My or According to me

#Format:

Introduction:

        1. Provide background info of the problem statement.
  1. Define key terms.