Skip to content

Instantly share code, notes, and snippets.

View dev-ritik's full-sized avatar
👨‍💻
Code Stalking!

Ritik kumar dev-ritik

👨‍💻
Code Stalking!
View GitHub Profile
@dev-ritik
dev-ritik / Timber.java
Created March 23, 2019 18:38
My usual Android Timber plant message string format
private void setupTimber() {
Timber.plant(new Timber.DebugTree() {
@Override
protected String createStackElementTag(StackTraceElement element) {
return "timber " + super.createStackElementTag(element) + " : "+ element.getMethodName()+" : " + element.getLineNumber();
}
});
}
@dev-ritik
dev-ritik / Client.md
Last active July 4, 2020 18:00
Simple client program steps

Client

  1. Follow step 1 and 3 from the steps above to create a new socket for the client and establish address config to use. Use the same port as in Server and set IP as 127.0.0.1 if required. You might need inet_pton to do so. It converts String address 127.0.0.1 into network address to be used. This is stored in the sin_addr object.
  2. Connect to the already running server at the same port using the address config and the socket.
  3. Read and send the data from the socket similar to step 7 and 8 above.
  4. Close the socket whenever required.
@dev-ritik
dev-ritik / voting.c
Created May 3, 2019 19:05
The code for 4 switch voting machine with buzzer on Raspberry Pi
#include<wiringPi.h>
#include<stdio.h>
#define RS 11
#define EN 10
#define D4 6
#define D5 5
#define D6 4
#define D7 1
@dev-ritik
dev-ritik / Code.ino
Created May 3, 2019 19:29
Code for Arduino based Temperature Humidity measuring device
#include<dht.h> // Including library for dht
#include<LiquidCrystal.h>
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);
#define dht_dpin 12
dht DHT;
byte degree[8] =
{
@dev-ritik
dev-ritik / Myclass.java
Last active July 6, 2019 16:18
Segment fetcher test details
import net.named_data.jndn.*;
import net.named_data.jndn.util.SegmentFetcher;
import java.io.IOException;
import net.named_data.jndn.util.Blob;
public class Myclass {
private static String formatThroughput(double throughput)
{
@dev-ritik
dev-ritik / Client.java
Last active August 15, 2019 12:27
Code for checking interest.setApplicationParameters
import net.named_data.jndn.*;
import net.named_data.jndn.util.SegmentFetcher;
import java.io.IOException;
import net.named_data.jndn.util.Blob;
import net.named_data.jndn.security.v2.ValidationPolicyAcceptAll;
import net.named_data.jndn.security.v2.Validator;
import net.named_data.jndn.NetworkNack;
import net.named_data.jndn.OnData;
import net.named_data.jndn.OnNetworkNack;
import net.named_data.jndn.OnTimeout;
@dev-ritik
dev-ritik / Progress.md
Last active July 4, 2020 17:59
Summary of work done in GSoC on NDN

Introduction

Google Summer of Code is a global program focused on bringing more student developers into open source software development. Students work with an open-source organization on a 3-month programming project during their break from school.

The actual timeline of GSoC is available here. The main coding period spans between 27 May and 19 August and is divided into 3 parts each one following an evaluation.

Project Introduction

NpChat is a photo and file-sharing application built on Android and is inspired by Snapchat. It runs over the Named Data Network (NDN) and focuses on decentralised information sharing architecture. It stands as one of the best examples of Android application developed on the new Internet architecture.

The project description can be found here. The project aims to improve the functionalities of the erstwhile NpChat application. D

@dev-ritik
dev-ritik / ca-module.cpp
Created August 24, 2019 09:38
Code for running modified ndncert-ca-server for android-identity-manager
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
* Copyright (c) 2017-2019, Regents of the University of California.
*
* This file is part of ndncert, a certificate management system based on NDN.
*
* ndncert is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
@dev-ritik
dev-ritik / Report.md
Created August 25, 2019 17:46
Report for my project on NpChat for the Google Summer of Code 2019

Android App Improvement

Introduction

NpChat is a photo and file-sharing application built on Android and is inspired by Snapchat. It runs over the Named Data Network (NDN) and focuses on decentralised information sharing architecture. It stands as one of the best examples of Android application developed on the new Internet architecture.

The project description can be found here. During Google Summer of Code 2019, I contributed to the project and developed several features to improve the NpChat app, its supporting library(Jndn) and the Identity Manager.

Work

@dev-ritik
dev-ritik / Release.md
Created August 28, 2019 09:17
Releaase notes for NpChat to Play Store

Short description

npChat is a photo and file-sharing application built on Android and is inspired by Snapchat.

Full description

We present npChat, an Android application that allows users to capture and share multimedia with friends in a secure and fully decentralized way, while still giving users complete control over their data as well as communication.

The project's goals are to develop the completely decentralized application to runs over the Named Data Network (NDN), utilize a partial sync protocol and utilize a Web-Of-Trust like model