Skip to content

Instantly share code, notes, and snippets.

View arestifo's full-sized avatar

Alex Restifo arestifo

  • SpaceX
  • Redmond, WA
  • 23:39 (UTC -08:00)
View GitHub Profile
@arestifo
arestifo / ProGAN v3.py
Created May 19, 2020 01:37
Working (up to 1024x1024) version of my progressively growing GAN implementation in TensorFlow + Keras
import tensorflow as tf
from tensorflow.keras import layers, Model, optimizers, initializers, constraints
from tensorflow.keras import backend as k
from tensorflow.keras.layers import Dense, Conv2D, Input, LeakyReLU, Reshape, Flatten
from tensorflow.keras.layers import AveragePooling2D, UpSampling2D
from tensorflow.keras.constraints import max_norm
import matplotlib.pyplot as plt
import numpy as np
import glob
import os
@arestifo
arestifo / gist:ddbabf50b70446aaf57f296fdb5db936
Created May 31, 2019 16:15
Pseudocode for TIDE paper pipeline
# Create a new predictor
tide = new ICBResponsePredictor()
# There are two processes the predictor models to come up with a ICB response score:
# 1) Level of T-cell dysfunction in tumors with high CTL levels. Tumors with high CTL levels but also high T-cell dysfunction are shown to have worse responses to ICB.
# 2) Effects of certain cell types on CTL infiltration level; why certain tumors are low-CTL in the first place. Low-CTL tumors are shown to have a worse response to ICB.
#### FIRST PROCESS ####
# Get tumor expression datasets from the following databases and filter them
@arestifo
arestifo / CodeStudioMandelbrot.js
Created January 26, 2017 19:26
Draws the mandelbrot set on code studio. Done for AP Computer Science Principles
var height = 300;
var width = 300;
var max_iters = 50;
console.log("Creating arrays");
var pixels = createArray(height, width);
var palette = createArray(max_iters);
function drawMandelPix(sX, sY) {
var xC = 0.0;
@arestifo
arestifo / IMEIChecker.cs
Created April 4, 2016 01:26
Code that verifies if an IMEI is valid
using System;
namespace LuhnAlgo
{
class IMEIChecker
{
static void Main(string[] args)
{
Console.WriteLine(CheckIMEI(980293730373763)); // "true"
Console.WriteLine(CheckIMEI(980293730373764)); // "false" because check digit is not correct
Console.ReadKey(); // pause before exiting
(function() {
var f5_cspm = {
f5_p: 'BDNINOGGMDOLHFCOJAANDEJOKLPHMMBONGPBGOGCAJFBGBLCNAFONCMEODJAAHKJPNMGCACOAKDOOLOIAJDPBBPMJCFFCEBFDOLLDCOONKDIPFNKNNFOOFCIBBGFCBHA',
setCharAt: function(str, index, chr) {
if (index > str.length - 1) return str;
return str.substr(0, index) + chr + str.substr(index + 1);
},
get_byte: function(str, i) {
var s = (i / 16) | 0;
i = (i & 15);
package com.bcchack.ap;
import static java.lang.System.out;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Arrays;
@arestifo
arestifo / gist:0b1ad7aaad096f70d64f
Created May 29, 2015 16:38
Matrix multiplication class (actual multiplication)
package com.bcchack.ap;
public class MatrixMultiply {
public static int[][] multiplyMatrices(int[][] a, int[][] b)
{
int[][] ret = new int[a.length][b[0].length];
for (int row = 0; row < a.length; row++)
{
for (int col = 0; col < b[0].length; col++)
{
@arestifo
arestifo / gist:fe94fa62f265edb0f34b
Created May 29, 2015 16:37
Obfuscated matrix multiplier
package com.bcchack.ap;
import static java.lang.System.out;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Scanner;
public class TesterMatrices {
//static int[][] m1 = {{1, 2, -2, 0}, {-3, 4, 7, 2}, {6, 0, 3, 1}};
//static int[][] m2 = {{-1, 3}, {0, 9}, {1, -11}, {4, -5}};
public static void main(String[] args) throws FileNotFoundException
import static java.lang.System.out;
import java.awt.Color;
import java.awt.Dimension;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.Scanner;
import javax.swing.BoxLayout;
@arestifo
arestifo / CeasarCipher
Created November 24, 2014 18:16
CeasarCipher in C#!
using System;
using System.Collections.Generic;
class Program
{
static readonly char[] alpha = "abcdefghijklmnopqrstuvwxyz".ToCharArray();
static void Main(string[] args)
{
Console.WriteLine(CeasarEncrypt("yz", 1));
Console.ReadKey();
}