Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View donigian's full-sized avatar

armen donigian donigian

  • Jet Propulsion Labratory
  • Pasadena
View GitHub Profile
@donigian
donigian / tensorflow_test_script
Created December 11, 2017 06:00
TensorFlow Test Script
import tensorflow as tf
with tf.device('/cpu:0'):
a_c = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a-cpu')
b_c = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b-cpu')
c_c = tf.matmul(a_c, b_c, name='c-cpu')
with tf.device('/gpu:0'):
a_g = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a-gpu')
b_g = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b-gpu')
@donigian
donigian / install_cuda.sh
Last active July 9, 2018 19:39
Install CUDA Ubuntu for Google Cloud Platform
#!/bin/bash
echo "Checking for CUDA and installing."
# Check for CUDA and try to install.
if ! dpkg-query -W cuda; then
# The 16.04 installer works with 16.10.
curl -O http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_8.0.61-1_amd64.deb
dpkg -i ./cuda-repo-ubuntu1604_8.0.61-1_amd64.deb
apt-get update
apt-get install cuda -y
fi
@donigian
donigian / gist:9fb7fb2265df82dd0e7f
Created March 25, 2016 14:50
Install Jupyter IPython Notebooks for Python 2 and 3
configure the python2.7 environment:
conda create -n py27 python=2.7
source activate py27
conda install notebook ipykernel
ipython kernel install
configure the python3.5 environment:
@donigian
donigian / building-a-production-data-warehouse.md
Last active February 16, 2024 10:56
building a production data warehouse

Building a Production Data Warehouse

So I hear business is going well...customers are flocking to your site/app...people just can't get enough? Congratulations, this is a huge step most companies don't reach.

What now? Well, business analysts, modelers, engineers, customer support and marketing want to access an authoritative, consistent, timely access to your organization's data. Perhaps we can build some beautiful dashboards to visualize KPIs for executive management.

You're in need of a Data Warehouse? Maybe a Data Lake? Where do you start? What sort of considerations & alternatives should you think about.

Turns out there are a variety of things you must take into consideration depending on your requirements. A good place to start is to interview & establish a relationship with team leads to better understand their needs. As you're going through the discovery process, here's an algorithm of the types of things you'll need to consider in your discovery phase.

What is a Data Warehouse? Data Lak

@donigian
donigian / count_duplicates.rb
Last active August 29, 2015 14:25
Count duplicates by using only single variable
class InterviewQuestions
def initialize(count=0)
@count = 0
end
def count_duplicates(arr)
arr.sort! # your favorite sorting algo (n log n)
arr.each_with_index {|index|
if (index + 1 < arr.length)
if (arr[index+1]==arr[index])
@donigian
donigian / lessons_learned.md
Last active August 29, 2015 14:24
students_lesson_learned

Advice to my junior software engineering students

Since starting to teach Computer Science at Pasadena Community College, I've often wondered what advice I would give to my previous self 15 years ago when I first embarked on this journey to become a software engineer.

Here's what I would tell previous myself (ie. current students)...

####Best career advice I ever got

  • Find what you Love...that you can be Great at...for which others will Pay you!
  • Love it or leave it

####Be a Craftsman

@donigian
donigian / git_csa.rb
Created July 12, 2015 04:31
Git Command Suite Application
#!/usr/bin/env ruby
require 'gli'
include GLI::App
program_desc 'Implementing Command Suite Application for Git'
version Git::VERSION
subcommand_option_handling :normal
arguments :strict
@donigian
donigian / vertical_partitioning.sql
Last active August 29, 2015 14:24
vertical partitioning example
/* Consider the following table...*/
create table data (
id integer primary key,
status char(1) not null,
data1 varchar2(10) not null,
data2 varchar2(10) not null);
/* You can split via most frequent vs rarely used table columns */
create table data_main (
@donigian
donigian / DomainShardRecord.scala
Created July 12, 2015 04:24
DomainShardRecord
/* Purpose of DomainShardRecord is to store/correlate Domain Partition for a particular userId.
To surpass the max column width limitation with RDBMs, you can implement additional case classes for other Entities. */
case class DomainShardRecord(userId: String, password: String, userName: String)
@donigian
donigian / UserShardRecord.scala
Created July 12, 2015 04:23
UserShardRecord
/* Purpose of UserShardRecord is to store/correlate shardId for a particular userId */
case class UserShardRecord(userId: String, shardId: String)