Skip to content

Instantly share code, notes, and snippets.

View Kaushal28's full-sized avatar
🎯
Focusing

Kaushal Shah Kaushal28

🎯
Focusing
  • Juniper Networks
  • Bangalore
View GitHub Profile
@Kaushal28
Kaushal28 / Main2Activity.java
Last active August 30, 2016 13:11
This is my activity from where the place picker activity is called on button click. (Main2Activity)
package com.example.kaushal28.locationbasedreminder;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.v4.app.NavUtils;
import android.support.v7.app.AppCompatActivity;
@cyhsutw
cyhsutw / MathJax.ipynb
Last active August 31, 2023 05:43
Grabbed from https://github.com/odewahn/ipynb-examples, converted to v3 for GitHub to render.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Momoumar
Momoumar / JupyterNotebookDownloader.sh
Last active May 11, 2023 19:46
Download all programming assignments Notebook. #Coursera #DeepLearning.ai #Jupyter #Python
#To download all your programming assignments including all files and notebooks, follow these steps:
#1 - Go to the root tree folder for instance: https://hub.coursera-notebooks.org/user/${user_token}/tree/
#2- Open the terminal by clicking the + button on the right-hand corner
#3 - Enter the following command in the terminal:
tar cvfz allassignments.tar.gz *
#4 - The previous command will create a zip named allassignments containing all your programmings assignment
#5 - Select allassignments.tar.gz and download
#6 - Enjoy, don't forget to delete it afterward ;-)
import numpy as np
T = np.load('datasets/T.npy')
for i in range(12):
for j in range(4):
print (T[i,:,j])
'''
[0.9 0.1 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. ] for starting state (1,1) and action Down
[0.9 0. 0. 0. 0.1 0. 0. 0. 0. 0. 0. 0. ] for starting state (1,1) and action Left
[0.1 0.1 0. 0. 0.8 0. 0. 0. 0. 0. 0. 0. ] for starting state (1,1) and action Up
@alicarbonteq
alicarbonteq / readme.md
Last active September 22, 2023 01:57
Conflict Resolution (Vector Clock in Distributed System)

Conflict Resolution (Vector Clock in Distributed System)

Definition

Vector Clocks are used in a distributed systems to determine whether pairs of events are causally related. Using Vector Clocks, timestamps are generated for each event in the system, and their causal relationship is determined by comparing those timestamps.

Vector clock is use to control the ordering of multi-version records.

  • Use in key-value store like riak, Dynamo
  • Enables causality to be captured
  • With vector clocks, we assume we know about each participating process
  • Suppose there are N processes in the group [1…N]