Skip to content

Instantly share code, notes, and snippets.

View atakangah's full-sized avatar

Andrews Kangah atakangah

View GitHub Profile

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@atakangah
atakangah / building_tensorflow.md
Created November 8, 2021 15:23 — forked from kmhofmann/building_tensorflow.md
Building TensorFlow from source

Building TensorFlow from source (TF 2.3.0, Ubuntu 20.04)

Why build from source?

The official instructions on installing TensorFlow are here: https://www.tensorflow.org/install. If you want to install TensorFlow just using pip, you are running a supported Ubuntu LTS distribution, and you're happy to install the respective tested CUDA versions (which often are outdated), by all means go ahead. A good alternative may be to run a Docker image.

I am usually unhappy with installing what in effect are pre-built binaries. These binaries are often not compatible with the Ubuntu version I am running, the CUDA version that I have installed, and so on. Furthermore, they may be slower than binaries optimized for the target architecture, since certain instructions are not being used (e.g. AVX2, FMA).

So installing TensorFlow from source becomes a necessity. The official instructions on building TensorFlow from source are here: ht

@atakangah
atakangah / image-predict-on-tfjs-node.js
Created November 5, 2021 05:20 — forked from mugifly/image-predict-on-tfjs-node.js
Image Prediction on tfjs-node (with model made by Teachable Machine Image)
const tf = require('@tensorflow/tfjs-node');
const Jimp = require('jimp');
// Directory path for model files (model.json, metadata.json, weights.bin)
// NOTE: It can be obtained from [Export Model] -> [Tensorflow.js] -> [Download my model]
// on https://teachablemachine.withgoogle.com/train/image
const MODEL_DIR_PATH = `${__dirname}`;
// Path for image file to predict class
const IMAGE_FILE_PATH = `${__dirname}/example.jpg`;
@atakangah
atakangah / README.md
Created June 4, 2021 14:29 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@atakangah
atakangah / debugging_1.js
Created July 12, 2020 12:18
Shows debugging database calls
//Update new system status
let updateResult = await System.updateOne({ 'systemId': SYSTEM_ID }, system[0], { upsert: true }).exec();
console.log('Update Result:', updateResult);
@atakangah
atakangah / await_demon_2.js
Created July 12, 2020 11:50
This shows fixes on await demon 2
try {
//Update new system status
await System.updateOne({ 'systemId': SYSTEM_ID }, system[0], { upsert: true }).exec();
@atakangah
atakangah / await_demon_1.js
Last active July 12, 2020 11:49
This shows fixes on await demon 1
// Update student data with new data without the deleted course
try {
let ccompleteRes = await Students.updateOne({ 'studentId': studentId }, student[0], { upsert: true }).exec();
@atakangah
atakangah / async_demon_2.js
Created July 12, 2020 11:45
This shows fixes in async demon 2
async function updateCompletedStudents(courseId, student, res) {
/*
* Substract -1 from @continuingStudents on system
*/
@atakangah
atakangah / async_demon.js
Created July 12, 2020 11:44
This shows fixes in async demons
router.post('/complete-student-course', async (req, res) => {
let {studentId, courseId} = req.body;
async function updateCompletedStudents(courseId, student, res) {
/*
* Substract -1 from @continuingStudents on system
*/
try {
//Get current system data
let system = await System.find({ 'systemId': SYSTEM_ID }).exec();