Skip to content

Instantly share code, notes, and snippets.

View yasith's full-sized avatar
🐢

Yasith Vidanaarachchi yasith

🐢
  • Google
  • Toronto, Canada
  • 14:39 (UTC -05:00)
View GitHub Profile
@yasith
yasith / ubuntu16_tensorflow_cuda8.sh
Last active August 17, 2017 05:20 — forked from ksopyla/ubuntu16_tensorflow_cuda8.sh
How to set up tensorflow with CUDA 8 cuDNN 5.1 in virtualenv with Python 3.5 on Ubuntu 16.04 http://ksopyla.com/2017/02/tensorflow-gpu-virtualenv-python3/
# This is shorthened version of blog post
# http://ksopyla.com/2017/02/tensorflow-gpu-virtualenv-python3/
# update packages
sudo apt-get update
sudo apt-get upgrade
#Add the ppa repo for NVIDIA graphics driver
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update

Keybase proof

I hereby claim:

  • I am yasith on github.
  • I am yasith (https://keybase.io/yasith) on keybase.
  • I have a public key whose fingerprint is 8664 50EE 0748 9FA4 D4BD 1587 D445 ADFD 58D5 5DBC

To claim this, I am signing this object:

width, height = raw_input().split()
width, height = int(width), int(height)
maze = []
for i in xrange(height):
maze.append(list(raw_input()))
startx, starty, color = raw_input().split()
startx, starty = int(startx), int(starty)
from raspberrypions import peon_task
def countAs(sequence):
num = 0
for char in sequence:
if char is 'A':
num += 1
return num
@yasith
yasith / scrape.py
Created December 16, 2012 16:48
Python Scraper
import requests
import re
from bs4 import BeautifulSoup
page = requests.get(self.getUrl()).text
soup = BeautifulSoup(page)
regex = re.compile('nextPassingTimes.*')
links = soup.findAll('a', {'href': regex})
@yasith
yasith / LinkedListQueue.py
Created October 28, 2012 16:07
Queue with a linked list
class EmptyQueueException(Exception):
pass
class LinkedListQueueNode:
def __init__(self, data):
self._next = None
self._data = data
def set_next(self, n):
self._next = n
@yasith
yasith / gist:3489609
Created August 27, 2012 15:38
Cocos2d-x Particle
if(mEarnedPointAccumulator > blastPoint)
{
// Create the particle
cocos2d::CCParticleSystemQuad *pEmitter = CCParticleSystemQuad::particleWithFile("ScoreNumber.plist");
cocos2d::CCPoint particlePosition = getScoreLabel()->getPosition();
float width = (float)getScoreLabel()->getContentSizeInPixels().width * 0.575f;
// Starting position of the numbers (first digit)
@yasith
yasith / android-snippet.java
Created July 25, 2012 16:12
Android Button & Location
/**
* Called when the user taps the Update Location Button
*/
public void updateLocation(View view) {
Log.d(TAG, "Updating Location");
TextView textView = (TextView) findViewById(R.id.location_label);
LocationManager locationManager = (LocationManager)
this.getSystemService(Context.LOCATION_SERVICE);
@yasith
yasith / ButtonListener.java
Created June 23, 2012 11:25
Listener for the libGDX Button
package yasith.util;
public interface ButtonListener {
// Called by Buttons when they are clicked
public abstract void onClickListener(String key);
}
@yasith
yasith / b.cpp
Created April 28, 2012 04:58
CodeJam '12 Round1 B
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>