Skip to content

Instantly share code, notes, and snippets.

View facekunal's full-sized avatar

Kunal Kotiyal facekunal

  • Bangalore
View GitHub Profile
boolean isEqualSum(int[] a, int[] b) {
Arrays.sort(a);
Arrays.sort(b);
int sumA = Arrays.stream(a).sum();
int sumB = Arrays.stream(b).sum();
int diff = sumB - sumA;
if(diff % 2 == 1) {
@facekunal
facekunal / equalSumSwap_naive.java
Created July 4, 2020 13:56
Swapping pair make sums equal - Naive
boolean isEqualSum(int[] a, int[] b) {
int sumA = Arrays.stream(a).sum();
int sumB = Arrays.stream(b).sum();
for(int i=0;i<a.length;i++){
for(int j=0;j<b.length;j++) {
if (sumA - a[i] + b[j] == sumB - b[j] + a[i]) {
return true;
}
}
# "Colorizing B/W Movies with Neural Nets",
# Network/Code Created by Ryan Dahl, hacked by samim.io to work with movies
# BACKGROUND: http://tinyclouds.org/colorize/
# DEMO: https://www.youtube.com/watch?v=_MJU8VK2PI4
# USAGE:
# 1. Download TensorFlow model from: http://tinyclouds.org/colorize/
# 2. Use FFMPEG or such to extract frames from video.
# 3. Make sure your images are 224x224 pixels dimension. You can use imagemagicks "mogrify", here some useful commands:
# mogrify -resize 224x224 *.jpg
# mogrify -gravity center -background black -extent 224x224 *.jpg
@facekunal
facekunal / weather.py
Created June 9, 2016 07:24 — forked from jleclanche/weather.py
Quick python weather script using Google's Weather API
#!/usr/bin/env python
# encoding: utf-8
import sys
from argparse import ArgumentParser
from xml.dom import minidom
try:
from urllib.request import urlopen
from urllib.parse import urlencode
except ImportError: