This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include<stdlib.h> | |
template <typename T> | |
int Sum(T t) | |
{ | |
return t; | |
} | |
template<typename T, typename... Args> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void MatrixMultiplyTiled(vector<int>& vC, const vector<int>& vA, | |
const vector<int>& vB, int M, int N, int W) | |
{ | |
// first mat: M × W | |
// second mat: W × N | |
// Note that the const before the float when creating a and b, | |
// will result in the underling data only being copied to the accelerator | |
// and not be copied back – a nice optimization. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib.request | |
import sys | |
counter = 0 | |
def main(start, end): | |
""" | |
To get the list of reciters, visit this link http://althkr.com/Reciters.php | |
Note that the folder will be downloaded in the current directory. Make sure you have space | |
and that you can handle the clutter. I suggest running the script in an empty folder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Updates the system, answering all the prompts with "yes" then shuts the PC down after 20 mins of completion | |
# only IF the update process completes successfully | |
# Helpful if you want to start an update and go to bed zzzzzZzZzZZ | |
yes | pacman -Syu && shutdown 20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <ctype.h> // for tolower | |
// Set buffer sizes | |
#define MAX_SIZE 256 | |
#define SMALL_BUFF_SIZE 8 | |
void replace_newline_with_null(char *s) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source: https://webkul.com/blog/python-imaging-librarypil-examples/ | |
from PIL import Image | |
from PIL import Image | |
from PIL import ImageEnhance | |
from PIL import ImageDraw, ImageFont | |
img = Image.open("original.jpg") | |
margin_left,margin_top = img.size | |
width, height = img.size | |
image_mode = img.mode | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Author: @shakram02 | |
* Replaces Alef, Waw, Yeh variants with their original letters [plain Alef, plain Waw, plain Yeh]. | |
* Removes Arabic-related symbols and ligatures | |
*/ | |
object ArabicNormalizer { | |
private val ALEF = "\u0627" | |
private val WAW = "\u0648" | |
private val YEH = "\u064A" | |
private val normalizationCache: HashMap<String, String> = hashMapOf() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
The MIT License (MIT) | |
[OSI Approved License] | |
The MIT License (MIT) | |
Copyright (c) 2015 Zulko | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::collections::HashMap; | |
use std::fs; | |
use std::io::Read; | |
use std::path::Path; | |
fn get_macs() -> HashMap<String, String> { | |
// cat the /sys/class/net/iface/address to get the MAC | |
// based on: https://stackoverflow.com/questions/26346575/how-to-get-mac-address-in-rust | |
let net = Path::new("/sys/class/net"); | |
let entry = fs::read_dir(net).expect("Error"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
./configure --enable-libopenh264 --enable-libx264 --enable-libwavpack --enable-libvorbis --enable-libopus --enable-libmp3lame --enable-libass --enable-libdav1d --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libopenjpeg --enable-gpl --enable-nonfree | |
6243 ./configure --enable-libopenh264 --enable-libx264 --enable-libwavpack --enable-libvorbis --enable-libopus --enable-libmp3lame --enable-libass --enable-libdav1d --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libopenjpeg --enable-libsoxr --enable-gpl --enable-nonfree |
OlderNewer