Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Akshay Naik nakshay

🎯
Focusing
View GitHub Profile
@nakshay
nakshay / java_rust_generic.md
Created Mar 6, 2020 — forked from Kimundi/java_rust_generic.md
A light comparison between Rust and Java generics and type system features.
View java_rust_generic.md

Introduction

If you are familiar with Java's generics, and are coming to Rust, you might be lead to assume that its generics are working the same way.

However, due to the different type systems, and different implementation details, there are quite a few differences between generic code in both languages.

This document tries to give a short summary about those differences:

Core functionality

Java

View Hack.java
//Given a number, in the form of an array a[] containing digits from 1 to 9(inclusive). The task is to find the next smallest palindrome larger than this number.
//
//Input :
//The first line is number of test cases T. Every testcase contains two lines. The first line contains the size of the array, second line contains the digits of the number separated by space.
//
//Output:
//In each separate line print the digits of palindrome with spaces in between.
//
//Constraints:
//1<=T<=100
@nakshay
nakshay / SSHClient.java
Created Dec 17, 2019
SSH client in java using Jcraft JSCH library
View SSHClient.java
import com.jcraft.jsch.Channel;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;
public class SSHClient {
public static void main(String[] args) {
try {
JSch jsch = new JSch();