Main thread triggers the computing of fib(100) by worker thread on button click. Once done, the worker transmits the result to the main thread.
Browser cannot load local js file containing worker.
python -m http.server
#include <stdio.h> | |
#include <complex.h> | |
#include <gd.h> | |
/** | |
* Produce a fractal image using Mandelbrot set | |
* - Js implementation: https://www.youtube.com/watch?v=6z7GQewK-Ks | |
* - Description: https://en.wikipedia.org/wiki/Mandelbrot_set | |
* - GD documentation: https://libgd.github.io/manuals/2.1.1/files/preamble-txt.html | |
* |
#include <vtkNew.h> | |
#include <vtkCylinderSource.h> | |
#include <vtkPolyDataMapper.h> | |
#include <vtkActor.h> | |
#include <vtkRenderer.h> | |
#include <vtkRenderWindow.h> | |
#include <vtkRenderWindowInteractor.h> | |
/* vtkNew allocates & init instance of vtk object on construction */ | |
int main() { |
#include <pcl/common/distances.h> | |
#include <pcl/io/pcd_io.h> | |
#include <pcl/visualization/cloud_viewer.h> | |
#include <pcl/filters/passthrough.h> | |
int main() { | |
// pointer to pointcloud | |
pcl::PointCloud<pcl::PointXYZ>::Ptr pointcloud(new pcl::PointCloud<pcl::PointXYZ>); | |
// load pcd pointcloud file |
""" Get tweets from the profile page of a given USER """ | |
import sys | |
from selenium import webdriver | |
from selenium.common.exceptions import TimeoutException | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support import expected_conditions as EC | |
# get twitter user from command-line | |
if len(sys.argv) != 2: |
# fdisk -l # determine Linux partition (e.g. /dev/sda1)
# mount /dev/sda1 /mnt
# mount --bind /dev /mnt/dev
# mount --bind /sys /mnt/sys
# mount --bind /proc /mnt/proc
# update-grub # in case it fails, run before it: grub-install /dev/sda
# umount /mnt/proc
# umount /mnt/sys
# umount /mnt/dev
# df -hT # Show filesystem of devices & partitions
# unmount /dev/sdb1 # Unmount usb stick
# mkfs.fat /dev/sdb1 # Format usb stick using FAT filesystem
# eject /dev/sdb1 # eject usb stick
From the 3rd edition of W. Richard Stevens's Advanced Programming in the Unix Environment 1.
Identifiers for variables and constants declared at file scope have external linkage (i.e. visible in other translation units).
Both are initialized to zero for variables and NULL for pointers by default, and exist for all the lifetime of the program.
*.c
file it was defined into (limited scope => optimal performance
).