Skip to content

Instantly share code, notes, and snippets.

@siddharthabhi30
siddharthabhi30 / gist:60488ecca8bc6bb0e17762b5abfade0a
Last active March 16, 2018 23:08
DIJKSTRA algo in python along with Binary heap,vertex,graph implementation
class binaryheap():
def __init__(self):
self.list=[]
def add(self,k):
self.list.append(k)
@0x4D31
0x4D31 / beautiful_idiomatic_python.md
Last active November 23, 2025 09:16 — forked from JeffPaine/beautiful_idiomatic_python.md
[Beautiful Idiomatic Python] Transforming Code into Beautiful, Idiomatic Python #python

Transforming Code into Beautiful, Idiomatic Python

Notes from Raymond Hettinger's talk at pycon US 2013 video, slides.

The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Looping over a range of numbers

for i in [0, 1, 2, 3, 4, 5]:
# Copyright 2014 Google Inc. All Rights Reserved.
# 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
# distributed under the License is distributed on an "AS IS" BASIS,
@anirudhjayaraman
anirudhjayaraman / graphUndirected.py
Last active February 16, 2021 01:50
Implementing Undirected Graphs in Python
class Vertex:
def __init__(self, vertex):
self.name = vertex
self.neighbors = []
def add_neighbor(self, neighbor):
if isinstance(neighbor, Vertex):
if neighbor.name not in self.neighbors:
self.neighbors.append(neighbor.name)
neighbor.neighbors.append(self.name)
@amyjko
amyjko / cer.md
Last active December 16, 2020 19:14
@Kaixhin
Kaixhin / guidelines.md
Last active May 12, 2022 05:29
Student Projects

I supervise undergraduate/postgraduate/UROP projects as part of BICV. The PI, Dr Anil Bharath, has a nice set of FAQs for prospective research students, which should give you an idea of what our group specialises in. My topic of research is deep reinforcement learning, which is less focused on computer vision and more on general machine learning or even artificial intelligence. Note that I only supervise students at Imperial College London, so please do not contact me about supervision otherwise.

I expect students to be a) highly motivated and b) technically proficient.

a) Projects that I supervise revolve around cutting-edge research, and specifically deep learning. Projects can, and have in the past, relied on research released during the course of the project. Some parts of machine learning can be found in optional modules in bioengineering courses, but (modern) deep learning is currently not taught at Imperial (as far as I am aware). I usually give crash

@udibr
udibr / beamsearch.py
Last active October 4, 2021 11:50
beam search for Keras RNN
# variation to https://github.com/ryankiros/skip-thoughts/blob/master/decoding/search.py
def keras_rnn_predict(samples, empty=empty, rnn_model=model, maxlen=maxlen):
"""for every sample, calculate probability for every possible label
you need to supply your RNN model and maxlen - the length of sequences it can handle
"""
data = sequence.pad_sequences(samples, maxlen=maxlen, value=empty)
return rnn_model.predict(data, verbose=0)
def beamsearch(predict=keras_rnn_predict,
@karpathy
karpathy / min-char-rnn.py
Last active March 5, 2026 03:44
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@labnol
labnol / google-apps-script.md
Last active October 1, 2025 19:50 — forked from junaidk/resources.md
How to Learn Google Apps Script

Learning Google Apps Script

Find the best resources for learning Google Apps Script, the glue that connects all Google Workspace services including Gmail, Google Drive, Calendar, Google Sheets, Forms, Maps, and more.

A good place to learn more about Google Apps Script is the official documentation available at developers.google.com. Here are other Apps Script resources that will help you get up to speed.

  1. Google Apps Script Code Samples by Amit Agarwal
  2. Google Apps Script Development - Create Google Apps Script projects locally inside VS Code - video tutorial
  3. Awesome Google Scripts by Amit Agarwal
  4. Google Developer Experts - Follow Apps Scr
@rxaviers
rxaviers / gist:7360908
Last active March 17, 2026 10:50
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: ๐Ÿ˜„ :smile: ๐Ÿ˜† :laughing:
๐Ÿ˜Š :blush: ๐Ÿ˜ƒ :smiley: โ˜บ๏ธ :relaxed:
๐Ÿ˜ :smirk: ๐Ÿ˜ :heart_eyes: ๐Ÿ˜˜ :kissing_heart:
๐Ÿ˜š :kissing_closed_eyes: ๐Ÿ˜ณ :flushed: ๐Ÿ˜Œ :relieved:
๐Ÿ˜† :satisfied: ๐Ÿ˜ :grin: ๐Ÿ˜‰ :wink:
๐Ÿ˜œ :stuck_out_tongue_winking_eye: ๐Ÿ˜ :stuck_out_tongue_closed_eyes: ๐Ÿ˜€ :grinning:
๐Ÿ˜— :kissing: ๐Ÿ˜™ :kissing_smiling_eyes: ๐Ÿ˜› :stuck_out_tongue: