Skip to content

Instantly share code, notes, and snippets.

View vanjikumaran's full-sized avatar

Vanjikumaran vanjikumaran

View GitHub Profile
import java.lang.Math;
public class NxNPattern
{
public static void main(String[] args)
{
for (int i = 0, j = 0; i < 49; i++) {
if (i % 7 == 0) {
if (j > 0) System.out.println();
j++;
@vanjikumaran
vanjikumaran / index.jsp
Created July 4, 2013 05:38
Index page that has the interface.
<%--
Created by IntelliJ IDEA.
User: vanji
Date: 6/22/13
Time: 2:07 PM
This example is demonstrate how to upload a file into given location of the server
--%>
<html lang="en">
<head>
<title>File Uploading Form</title>
<%--
Created by IntelliJ IDEA.
User: vanji
Date: 6/22/13
Time: 2:18 PM
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.io.*,java.util.*" %>
<%@ page import="org.apache.commons.fileupload.*" %>
@vanjikumaran
vanjikumaran / RESTfulExample_pom.xml
Last active December 19, 2015 16:19
JAX RS example Hello World
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.area51.rest</groupId>
<artifactId>RESTfulExample</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>RESTfulExample Maven Webapp</name>
<url>http://maven.apache.org</url>
@vanjikumaran
vanjikumaran / curlRequestjson
Created July 29, 2013 07:26
curlRequestjson
curl -i -H "Content-Type: application/json" -X POST -d '{
"peoples": {
"people": [
{
"class": "Person",
"name": "vanjikumaran",
"birthday": "today",
"nickname": "Oracle of Omaha",
"phonNumbers": {
"phonNumber": [
<definitions xmlns="http://ws.apache.org/ns/synapse">
<sequence name="main" onError="errorHandler">
<in>
<send>
<endpoint>
<loadbalance>
<endpoint>
<address uri="http://localhost:9001/services/LBService1">
<enableAddressing/>
<suspendDurationOnFailure>60</suspendDurationOnFailure>
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://ws.apache.org/ns/synapse">
<sequence name="errorHandler">
<log level="custom">
<property name="MESSAGE" value="Executing default &#34;fault&#34; sequence"/>
<property name="ERROR_CODE" expression="get-property('ERROR_CODE')"/>
<property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/>
</log>
<makefault response="true">
<code xmlns:tns="http://www.w3.org/2003/05/soap-envelope" value="tns:Receiver"/>
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://ws.apache.org/ns/synapse">
<registry provider="org.wso2.carbon.mediation.registry.WSO2Registry">
<parameter name="cachableDuration">15000</parameter>
</registry>
<proxy name="EntitlementService"
transports="https"
startOnLoad="true"
trace="disable">
# Experimention :- TCP flow vs TCP flow
# Experimenter :- Sivajothy Vanjikumaran
#Create a simulator object
set ns [new Simulator]
#Colors Define
$ns color 1 brown
$ns color 2 green
#Save throughput for the First tcp flow
set f1 [open tcp-tcp-one.tr w]
# Experimention :- TCP flow vs UDP flow
# Experimenter :- Sivajothy Vanjikumaran |
#Create a simulator object
set ns [new Simulator]
#Colors Define
$ns color 1 brown
$ns color 2 green
#Save throughput for the First tcp flow