This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #version 300 es | |
| precision highp float; | |
| precision highp sampler2D; | |
| // normalized coordinates, (0,0) is the bottom left | |
| in vec2 uv; | |
| // resulting fragment color, you may name it whatever you like | |
| out vec4 out_color; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <meta name="viewport" content="width=device-width,initial-scale=1" /> | |
| <title>Animated White Noise</title> | |
| <style> | |
| @property --angle { | |
| syntax: "<angle>"; | |
| inherits: false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <meta name="viewport" content="width=device-width,initial-scale=1" /> | |
| <title>Animated White Noise</title> | |
| <style> | |
| body { | |
| overflow: hidden; | |
| margin: 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Node: | |
| """ | |
| Vertex / Node in a bipartite graph | |
| Attributes | |
| ---------- | |
| id : int | |
| Unique identifier within a set | |
| set: int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Constant(): | |
| def __init__(self, value): | |
| self.value = value | |
| self.gradient = None | |
| def evaluate(self): | |
| return self.value | |
| def derivative(self, wrt_variable): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // filter.swift | |
| // fltr | |
| // | |
| // Created by Avinash on 18/06/19. | |
| // Copyright © 2019 eightyfive. All rights reserved. | |
| // | |
| import Metal | |
| import MetalKit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def find_k(arr_i, l ,r, ends): | |
| # ends here is a sorted array. | |
| # binary search | |
| while r - l > 1: | |
| m = (l+r)//2 | |
| if arr_i <= ends[m]: r = m | |
| else: l = m | |
| return r | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| n = 10 | |
| c = [2, 3, 5, 6] | |
| ways = [[0 if i < min(c) else - 1 for i in range(n + 1)] for j in c] | |
| def num_ways(n, c): | |
| row = len(c) - 1 | |
| # base case | |
| if n < min(c): return 0 | |