Skip to content

Instantly share code, notes, and snippets.

View edwingsm's full-sized avatar

Edwin George Saju edwingsm

View GitHub Profile
@edwingsm
edwingsm / Installer.bat
Last active October 31, 2022 17:05
Run as adminstrator
@echo off
echo **************************************
echo installing Chocholaty
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
echo **************************************
echo setting choco config
choco feature enable -n allowGlobalConfirmation
REM echo "Installing Chocolatey via power shell"
import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;
public class MySelectorClientExample {
private static final int BUFFER_SIZE = 1024;
private static String[] messages = { "The best way to predict the future is to create it.",
"As you think, so shall you become.", "The noblest pleasure is the joy of understanding.",
public IntegrationFlow jmsInboundFlow() {
return IntegrationFlows
.from(Jms.inboundAdapter(connectionFactory)
.destination("pan.outbound"))
.transform((String s) -> s.toUpperCase())
.channel("in-bound-request-channel")
.get();
}
@Bean
package com.example.spring.integration.springintegrationdemo;
import java.util.Arrays;
import java.util.stream.IntStream;
public class EarlyTime {
public static void main(String[] args) {
long t1 = System.currentTimeMillis();
System.out.println(solution(1, 8, 2, 3, 6, 4));
@edwingsm
edwingsm / Solution1.java
Created July 11, 2018 15:44
Buy and Sell Stock 1,2,3,4
public class Solution1 {
//https://leetcode.com/problems/best-time-to-buy-and-sell-stock/description/
public static void main(String[] args) {
int profit = maxProfit(new int[] { 7, 1, 5,1, 6, 4 });
System.out.println(profit);
}
public static int maxProfit(int[] prices) {
if (prices.length == 0)
@edwingsm
edwingsm / cd.json
Created April 29, 2014 04:52
Dummy Json sample
{
"CATALOG": {
"CD": [
{
"TITLE": "Empire Burlesque",
"ARTIST": "Bob Dylan",
"COUNTRY": "USA",
"COMPANY": "Columbia",
"PRICE": "10.90",
"YEAR": "1985"
@edwingsm
edwingsm / CD.XML
Last active August 29, 2015 14:00
Xml Dummy Sample
<?xml version="1.0" encoding="UTF-8" ?>
<CATALOG>
<CD>
<TITLE>Empire Burlesque</TITLE>
<ARTIST>Bob Dylan</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>Columbia</COMPANY>
<PRICE>10.90</PRICE>
<YEAR>1985</YEAR>
</CD>
@edwingsm
edwingsm / plants.xml
Last active August 29, 2015 14:00
dummy Xml data
<?xml version="1.0" encoding="UTF-8" ?>
<CATALOG>
<PLANT>
<COMMON>Bloodroot</COMMON>
<BOTANICAL>Sanguinaria canadensis</BOTANICAL>
<ZONE>4</ZONE>
<LIGHT>Mostly Shady</LIGHT>
<PRICE>$2.44</PRICE>
<AVAILABILITY>031599</AVAILABILITY>
</PLANT>
@edwingsm
edwingsm / palnts.json
Created April 28, 2014 11:05
Dummy Json File
{
"CATALOG": {
"PLANT": [
{
"COMMON": "Bloodroot",
"BOTANICAL": "Sanguinaria canadensis",
"ZONE": "4",
"LIGHT": "Mostly Shady",
"PRICE": "$2.44",
"AVAILABILITY": "031599"