Skip to content

Instantly share code, notes, and snippets.

View Rubix982's full-sized avatar
🇵🇰

Saif Ul Islam Rubix982

🇵🇰
View GitHub Profile
@Rubix982
Rubix982 / ChrisLattner,AI_Podcast_Notes.md
Created April 16, 2020 17:50
Chris Lattner: Compilers, LLVM, Swift, TPU, and ML Accelerators | Artificial Intelligence Podcast

Lex Fridman And Chris Lattner: on Compilers, LLVM, Swift, TPU, and ML Accelerators - Notes

This is a textual summary and list of notes of the podcast 'Artificial Intelligence Podcast' by Lex Fridman, from the episode Chris Lattner: Compilers, LLVM, Swift, TPU, and ML Accelerators.

About Chris Lattner:

Currently senior director at Google, working for projects covering CPU, GPU accelerators for Tensorflow, Google's library for Machine and Deep Learning, also involved in Swift related projects  

What Were Your First Initial Stages?

Performed basic programming by read and copying code from books  Started with simple GWBase, QBasic, then transitioned to Pascal, C, C++, and so and so forth.

#include <bits/stdc++.h>
using namespace std;
int main(void)
{
// Generates the value of the macro PI, without having to rely on an already existing macro in C++
// Since the macro varies from compiler to compiler
std::cout << "Value of PI: " << std::setprecision(20) << acos(-1) << std::endl;
return 0;
@Rubix982
Rubix982 / NthRoot.cpp
Last active December 26, 2019 06:55
Gives back Nth Root of a non-negative value, 'a'
#include <iostream>
using namespace std;
/*
Find nth root of a value a, Code from
https://www.quora.com/How-do-I-write-a-program-in-C-that-will-compute-the-nth-root-of-a-number-by-using-a-numerical-approximation-Newtons-Method-Calculations-must-be-based-on-just-square-and-or-cubic-roots
*/
double root ( double a, int n );
double IntPowFast( double x, int n );
@Rubix982
Rubix982 / NumberOfDigitsInTimeO(1).cpp
Created December 26, 2019 05:47
Gets back num of digits in O(1) time
#include "stdc++.h"
using namespace std;
// Gives back the number of digits in O(1) time
int main(void) {
std::cout << "<------- START ------->" << "\n";
for (int i = 1; i <= 50000; ++i) std::cout << (int) floor( 1 + log10( (double) i ) ) << " " << i << "\n";
@Rubix982
Rubix982 / LogWithoutSTLLog.cpp
Last active December 26, 2019 05:20
Implementation of Algorithm to calculate log of any base to any precision, using the technique described here: https://math.stackexchange.com/questions/820094/what-is-the-best-way-to-calculate-log-without-a-calculator#
#include <iostream>
#include <math.h>
#include <string>
using namespace std;
int main(void) {
uint_fast64_t b, p;
double start = 2;