Skip to content

Instantly share code, notes, and snippets.

View deusmachinea's full-sized avatar
🎯
focussing

deus_machinea deusmachinea

🎯
focussing
View GitHub Profile
@deusmachinea
deusmachinea / lassoregression.ipynb
Last active April 24, 2018 20:35
Lasso regression
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@deusmachinea
deusmachinea / convolution.ipynb
Last active April 24, 2018 20:34
Demo for implementing 2D convolution in python and numpy.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@deusmachinea
deusmachinea / lottery.sol
Created January 25, 2019 20:44
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.17+commit.bdeb9e52.js&optimize=false&gist=
pragma solidity ^0.4.17;
contract Lottery{
address public manager;
address[] public players;
function Lottery() public {
package main
import (
"fmt"
)
// Round returns the nearest integer, rounding ties away from zero.
func merge(a, b []int) []int {
package main
import (
"errors"
"fmt"
)
//Tree struct to define the tree
type Tree struct {
Value int
package main
import (
"errors"
"fmt"
)
//BFS to print the tree in breadth first fashion
func BFS(tree *Tree) []int {
//BFS to print the tree in breadth first fashion
func BFS(tree *Tree) []int {
queue := []*Tree{}
queue = append(queue, tree)
result := []int{}
return BFSUtil(queue, result)
}
//BFSUtil to help BFS
//Traversal Interfcae to implement
type Traversal interface {
Initialize() []int
PrintTraversal(stack []*Tree, res []int, visited map[int]bool) []int
util(stack []*Tree, res []int, visited map[int]bool) ([]int, []*Tree)
}
type defImplement struct {
}