Skip to content

Instantly share code, notes, and snippets.

View vectorijk's full-sized avatar

Kai Jiang vectorijk

  • Seattle, WA
  • 15:39 (UTC -07:00)
View GitHub Profile
@senarukana
senarukana / dot_product.py
Last active November 18, 2017 18:18
dot product sparse vector
# m + n
# element expressed as (pos, value)
def multiply1(vec1, vec2):
i = 0
j = 0
vec = []
while i < len(vec1) and j < len(vec2):
if vec1[i][0] > vec2[j][0]:
@skyfishjy
skyfishjy / CursorRecyclerViewAdapter.java
Last active December 16, 2023 08:55
CursorRecyclerViewAdapter
/*
* Copyright (C) 2014 skyfish.jy@gmail.com
*
* 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
@bigaidream
bigaidream / spark_ide.py
Last active January 14, 2018 08:30
To enable IDE (PyCharm) syntax support for Apache Spark, adopted from http://www.abisen.com/spark-from-ipython-notebook.html
#!/public/spark-0.9.1/bin/pyspark
import os
import sys
# Set the path for spark installation
# this is the path where you have built spark using sbt/sbt assembly
os.environ['SPARK_HOME'] = "/public/spark-0.9.1"
# os.environ['SPARK_HOME'] = "/home/jie/d2/spark-0.9.1"
# Append to PYTHONPATH so that pyspark could be found