Skip to content

Instantly share code, notes, and snippets.

View awaemmanuel's full-sized avatar
🎯
Focusing

Emmanuel Awa awaemmanuel

🎯
Focusing
View GitHub Profile
@awaemmanuel
awaemmanuel / read_embeddings.py
Created March 3, 2019 23:17 — forked from erickrf/read_embeddings.py
Read embeddings file in text format and convert to numpy
import numpy as np
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('input', help='Single embedding file')
parser.add_argument('output', help='Output basename without extension')
args = parser.parse_args()
embeddings_file = args.output + '.npy'
vocabulary_file = args.output + '.txt'
@awaemmanuel
awaemmanuel / understanding-word-vectors.ipynb
Created March 3, 2019 03:19 — forked from aparrish/understanding-word-vectors.ipynb
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@awaemmanuel
awaemmanuel / PrimeSum.cpp
Created April 14, 2018 14:30 — forked from cruxrebels/PrimeSum.cpp
Given an even number ( greater than 2 ), return two prime numbers whose sum will be equal to given number. NOTE A solution will always exist. read Goldbach’s conjecture Example: Input : 4 Output: 2 + 2 = 4 If there are more than one solutions possible, return the lexicographically smaller solution. If [a, b] is one solution with a <= b, and [c,d…
bool isPrime(int n)
{
for(int i=2; i*i<=n; ++i)
{
if(n%i==0)
return false;
}
return true;
}
@awaemmanuel
awaemmanuel / interviewitems.MD
Created April 5, 2018 02:18 — forked from KWMalik/interviewitems.MD
My answers to over 100 Google interview questions

##Google Interview Questions: Product Marketing Manager

  • Why do you want to join Google? -- Because I want to create tools for others to learn, for free. I didn't have a lot of money when growing up so I didn't get access to the same books, computers and resources that others had which caused money, I want to help ensure that others can learn on the same playing field regardless of their families wealth status or location.
  • What do you know about Google’s product and technology? -- A lot actually, I am a beta tester for numerous products, I use most of the Google tools such as: Search, Gmaill, Drive, Reader, Calendar, G+, YouTube, Web Master Tools, Keyword tools, Analytics etc.
  • If you are Product Manager for Google’s Adwords, how do you plan to market this?
  • What would you say during an AdWords or AdSense product seminar?
  • Who are Google’s competitors, and how does Google compete with them? -- Google competes on numerous fields: --- Search: Baidu, Bing, Duck Duck Go
@awaemmanuel
awaemmanuel / WAVE.py
Created March 22, 2018 02:58 — forked from viveksyngh/WAVE.py
Given an array of integers, sort the array into a wave like array and return it, In other words, arrange the elements into a sequence such that a1 >= a2 <= a3 >= a4 <= a5.....
# @param A : A List of integers
# @return List of integers
def wave(A):
A.sort()
i = 0
while i < len(A) :
if i + 1 < len(A) :
A[i], A[i+1] = A[i+1], A[i]
i = i + 2
else :
@awaemmanuel
awaemmanuel / gist:b5fb3a74202713797ff98f896c5e65e6
Created July 28, 2016 02:21 — forked from ngocdaothanh/gist:3764694
Scala Assignment: Recursion
package recfun
import scala.collection.mutable.ListBuffer
import common._
/** https://class.coursera.org/progfun-2012-001/assignment/view?assignment_id=4 */
object Main {
def main(args: Array[String]) {
println("Pascal's Triangle")
for (row <- 0 to 10) {
@awaemmanuel
awaemmanuel / UglyNumber.java
Created April 14, 2016 19:38 — forked from cangoal/UglyNumber.java
LeetCode - Ugly Number
//
public boolean isUgly(int num) {
if (num == 0) return false;
while (num % 2 == 0) num /= 2;
while (num % 3 == 0) num /= 3;
while (num % 5 == 0) num /= 5;
return num == 1;
}
//
public boolean isUgly(int num) {
@awaemmanuel
awaemmanuel / The Technical Interview Cheat Sheet.md
Created April 6, 2016 14:24 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@awaemmanuel
awaemmanuel / jupyter_shortcuts.md
Created March 16, 2016 23:55 — forked from kidpixo/jupyter_shortcuts.md
Keyboard shortcuts for ipython notebook 3.1.0 / jupyter

Toc

Keyboard shortcuts

The IPython Notebook has two different keyboard input modes. Edit mode allows you to type code/text into a cell and is indicated by a green cell border. Command mode binds the keyboard to notebook level actions and is indicated by a grey cell border.

MacOS modifier keys:

  • ⌘ : Command
@awaemmanuel
awaemmanuel / tmux-cheatsheet.markdown
Created February 9, 2016 12:20 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname