Skip to content

Instantly share code, notes, and snippets.

View manashmandal's full-sized avatar
👨‍💻
Probably Coding || ! Probably Coding

Manash Kumar Mandal manashmandal

👨‍💻
Probably Coding || ! Probably Coding
View GitHub Profile
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "jsmn.h"
#define JSON_FILE_PATH "../Parser/test.json"
#define BUFFER_SIZE 5000
#define MAX_TOKEN_COUNT 128
// Read files
@manashmandal
manashmandal / test.json
Last active July 30, 2017 18:50
JSMN Parser
{
"name" : "Manash",
"website" : "https://blog.manash.me",
"github" : "https://github.com/manashmndl",
"turnscoffeintocommits" : "yes"
}
@manashmandal
manashmandal / jasmine.c
Last active July 24, 2017 07:38
jasmine.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "jsmn.h"
/*
* A small example of jsmn parsing when JSON structure is known and number of
* tokens is predictable.
*/
@manashmandal
manashmandal / notebook.ipynb
Created July 17, 2017 09:18 — forked from eamartin/notebook.ipynb
Understanding & Visualizing Self-Normalizing Neural Networks
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@manashmandal
manashmandal / mp3towav.sh
Created July 9, 2017 04:18
Bulk Conversion From mp3 to wav using ffmpeg
for i in "/home/manash/me/research/text_to_speech/data/Gangtake_Gondogol/audio"/*
do
writefilename="/home/manash/me/research/text_to_speech/data/Gangtake_Gondogol/audio"/$(basename $i .mp3).wav
ffmpeg -i $i $writefilename
done
@manashmandal
manashmandal / apl-days.py
Created July 3, 2017 04:23
Generate dates and weekdays excluding weekends
#!/usr/bin/env python
# simply do the following to generate dates for month 12
# curl -s apl-days.py | python - 12 2017
from datetime import date
from calendar import monthrange
from sys import argv
# check if any argument is provided
@manashmandal
manashmandal / instructions.md
Created June 13, 2017 04:27 — forked from mcescalante/instructions.md
Run a Flask application with gunicorn and nginx

This guide assumes:

  • You have a VPS (something like DigitalOcean, Linode, etc.)
  • You have a Flask application and a basic understanding of command line instructions
  • You've got nginx installed and know where your configuration files are

Instructions

  1. First, you should install gunicorn on your box or virtualenv with pip:
import matplotlib.pyplot as plt
import numpy as np
def likelihood(theta):
return theta**7 * (1 - theta)**3
thetas = np.linspace(0, 1, 100)
L = [likelihood(thetas[i]) for i in range(len(thetas))]
theta_for_maximum_likelihood = thetas[np.argmax(L)]
import matplotlib.pyplot as plt
import numpy as np
def likelihood(theta):
return theta**7 * (1 - theta)**3
thetas = np.linspace(0, 1, 100)
L = [likelihood(thetas[i]) for i in range(len(thetas))]
plt.plot(thetas, L)
@manashmandal
manashmandal / map_data.json
Last active April 20, 2017 06:02
visa refusal data
[{
"country": "eufra",
"name": "France"
}, {
"country": "euprt",
"name": "Portugal"
}, {
"country": "euesp",
"name": "Spain"
}, {