Skip to content

Instantly share code, notes, and snippets.

View dipu-bd's full-sized avatar

Sudipto Chandra dipu-bd

View GitHub Profile
@dipu-bd
dipu-bd / KissAnime DeepDark (fixed).css
Last active June 29, 2018 19:54
Stylish extension style: KissAnime DeepDark (fixed)
/* Theme made by Sudipto <https://github.com/dipu-bd> */
/*GNU General Public License v3.0*/
/*Main color variables*/
:root {
/*User colors*/
--main-color: #00ADEE;
--main-background: #111111;
--second-background: #181818;
--hover-background: #232323;
@dipu-bd
dipu-bd / thumbnail.py
Last active September 14, 2017 14:15
Generate thumbnail of given shape with smart cropping using opencv library.
# Copyright (c) 2017 Sudipto Chandra <[email protected]>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
@dipu-bd
dipu-bd / KMP.cpp
Created June 29, 2017 19:29
Implementation of KMP. Complexity O(n+m)
/*==================================
Title: Implementation of KMP Algorithm
Complexity: O(n)
Author : Sudipto Chandra
===================================*/
#include <bits/stdc++.h>
using namespace std;
const int SIZ = 100050;
@dipu-bd
dipu-bd / SuffixArray+Search-v2.cpp
Created June 29, 2017 02:00
Search patterns within text using Suffix Array by utilizing C++ library functions
/*====================================================================
Title: Computes Longest Repeated Substring from a given string
Complexity: O(n.log(n))
Author : Sudipto Chandra (Dipu)
=====================================================================*/
#include <bits/stdc++.h>
using namespace std;
#define mem(a,b) memset(a, b, sizeof(a))
#define loop(i, x) for(__typeof((x).begin()) i=(x).begin(); i!=(x).end(); ++i)
#define rloop(i, x) for(__typeof((x).rbegin()) i=(x).rbegin(); i!=(x).rend(); ++i)
@dipu-bd
dipu-bd / SuffixArray+Search.cpp
Last active June 29, 2017 01:55
Count occurrences of a sub-string within the given text using Suffix Array
/*====================================================================
Title: Computes Longest Repeated Substring from a given string
Complexity: O(n.log(n))
Author : Sudipto Chandra (Dipu)
=====================================================================*/
#include <bits/stdc++.h>
using namespace std;
#define mem(a,b) memset(a, b, sizeof(a))
#define loop(i, x) for(__typeof((x).begin()) i=(x).begin(); i!=(x).end(); ++i)
#define rloop(i, x) for(__typeof((x).rbegin()) i=(x).rbegin(); i!=(x).rend(); ++i)
@dipu-bd
dipu-bd / SuffixArray_LRS.cpp
Last active March 10, 2018 07:58
Logest Repeated Substring (LRS) using suffix array. Complexity: O(n.log(n))
/*====================================================================
Title: Computes Longest Repeated Substring from a given string
Complexity: O(n.log(n))
Author : Sudipto Chandra (Dipu)
=====================================================================*/
#include <bits/stdc++.h>
using namespace std;
#define mem(a,b) memset(a, b, sizeof(a))
#define loop(i, x) for(__typeof((x).begin()) i=(x).begin(); i!=(x).end(); ++i)
#define rloop(i, x) for(__typeof((x).rbegin()) i=(x).rbegin(); i!=(x).rend(); ++i)
@dipu-bd
dipu-bd / SuffixArray+LCP.cpp
Last active June 29, 2017 11:13
Finding Longest Common Prefix (LCP) using Suffix Array. Complexity: SA=O(n.log(n)), LCP=O(n)
/*====================================================================
Title: Compute LCP from Suffix Array using Radix Sort
Suffix Array: O(n.log(n))
Compute LCP: O(n)
Author : Sudipto Chandra (Dipu)
=====================================================================*/
#include <bits/stdc++.h>
using namespace std;
#define mem(a,b) memset(a, b, sizeof(a))
#define loop(i, x) for(__typeof((x).begin()) i=(x).begin(); i!=(x).end(); ++i)
@dipu-bd
dipu-bd / SuffixArray.cpp
Last active February 22, 2020 13:48
Suffix array implementation using Radix Sort. Complexity: O(n.log(n))
/*==================================
Title: Suffix Array using Radix Sort
Complexity: O(n.log(n))
Author : Sudipto Chandra (Dipu)
===================================*/
#include <bits/stdc++.h>
using namespace std;
#define mem(a,b) memset(a, b, sizeof(a))
#define loop(i, x) for(__typeof((x).begin()) i=(x).begin(); i!=(x).end(); ++i)
#define rloop(i, x) for(__typeof((x).rbegin()) i=(x).rbegin(); i!=(x).rend(); ++i)
@dipu-bd
dipu-bd / TSV_to_JSON.cpp
Created February 22, 2017 14:41
Converts TSV file to JSON (not for general purpose)
/*
* Converts TSV file to JSON file.
*
* author: Sudipto Chandra Das
* license: MIT
*
*/
#include <bits/stdc++.h>
using namespace std;
@dipu-bd
dipu-bd / CustomHTMLEditor.java
Last active May 9, 2019 00:24
Added import data button in JavaFX HTMLEditor
/*
* Copyright 2015 Sudipto Chandra.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software