Skip to content

Instantly share code, notes, and snippets.

@raunakhajela
raunakhajela / main.dart
Last active January 18, 2019 13:22
weight_tracker flutter app
import 'package:flutter/material.dart';
import 'dart:math';
import 'package:intl/intl.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// var _routes = <String, WidgetBuilder>{
// AddContact.routeName: (BuildContext context) => new AddContact(title: 'Add Contact'),
// };
@raunakhajela
raunakhajela / main.dart
Created March 6, 2018 06:13
Listviews from JSON
import 'dart:async';
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
void main() {
runApp(new MaterialApp(
home: new HomePage()
));
@raunakhajela
raunakhajela / node_basics.md
Last active February 2, 2018 13:31
Node Basics
  • node is a javascript runtime that uses the v8 engine
  • v8 engine is an open source js engine written in c++ that uses the javascript code and compiles in machine code, it is used inside the nodes and in thee chrome browser
  • to run node file just type "node app.js" in cmd where app.js is your file name
  • to exite node process use "process.exit(0);" command in cmd
@raunakhajela
raunakhajela / split-join-test.jsp
Created January 14, 2018 10:38
JSP: JSTL Functions Tag "length", "toUpperCase" and "startsWith"
<!--
split() -> takes a delimited String and splits it up into an Array of Strings
join() -> concatenates a String array into single String based on a delimiter
-->
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<html>
<body>
@raunakhajela
raunakhajela / function-test.jsp
Created January 14, 2018 10:25
JSP: JSTL Functions Tag "length", "toUpperCase" and "startsWith"
<!--
JSTL Functions have two types of tags i.e Collection Length and String Manipulation tags.
Every page that uses the Function tags must include this reference:
uri="http://java.sun.com/jsp/jstl/functions" and prefix="fn"
-->
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<html>
<body>
@raunakhajela
raunakhajela / choose-student-test.jsp
Created January 13, 2018 13:28
JSP: JSTL Core Tag "choose"
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page import="java.util.*,com.jsp.tagdemo.Student" %>
<%
// just create some sample data ... normally provided by MVC
List<Student> data = new ArrayList<>();
data.add(new Student("John", "Doe", false));
data.add(new Student("Maxwell", "Johnson", false));
@raunakhajela
raunakhajela / if-student-test.jsp
Created January 13, 2018 13:24
JSP: JSTL Core Tag "if"
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page import="java.util.*,com.jsp.tagdemo.Student" %>
<%
// just create some sample data ... normally provided by MVC
List<Student> data = new ArrayList<>();
@raunakhajela
raunakhajela / Student.jsp
Created January 13, 2018 13:15
JSP: JSTL Core Tag forEach with HTML Table and Class
package com.jsp.tagdemo;
public class Student {
private String firstName;
private String lastName;
private boolean goldCustomer;
public Student(String firstName, String lastName, boolean goldCustomer) {
super();
@raunakhajela
raunakhajela / foreach-simple-test.jsp
Created January 13, 2018 12:51
JSP: JSTL Core Tag forEach
<!--
There are 5 core tags in JSP standard tag library i.e Core, Message Formatting, Functions, XML and SQL tags
-->
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
//sample data
String[] cities = {"Mumbai","Delhi","Kanpur"};
pageContext.setAttribute("myCities", cities);
@raunakhajela
raunakhajela / test.jsp
Created January 13, 2018 12:29
JSP: JSTL Demo
<!--
jsp custom tags - you can write your own custom code and use it as a tag
jsp standard tag library - it is creatd by oracle with common set of tags used by jsp environment
To use jsp cor tags copy these two files in WebContent/WEB-INF/lib folder : javax.servlet.jsp.jstl-1.2.1.jar and javax.servlet.jsp.jstl-api-1.2.1.jar
-->
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<body>