Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <signal.h>
void handler(int signal_number){
printf("Interrupt occured, Ctrl + C is pressed\n");
}
int main(){
signal(SIGINT, handler);
while(1){
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char* args[]) {
printf("Child process: getpid result: %d with arguments %s and %s\n", getpid(), args[1], args[2]);
sleep(5);
exit(52);
}
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char**argv) {
printf("Parent process: before fork getpid result: %d\n", getpid());
sleep(5);
{
'language':'en',
'orientation':'Up',
'textAngle':0.0,
'regions':[
{
'boundingBox':'689,768,2462,1049',
'lines':[
{
'boundingBox':'689,768,2462,180',
import requests
response = requests.post(ocr_url, headers=headers, params=params, json=data)
response.raise_for_status()
analysis = response.json()
print analysis
#Defining parameters and orientation
params = {'language': 'unk', 'detectOrientation ': 'true'}
#Defining image url
img = "https://quotefancy.com/download/18846/original/wallpaper.jpg"
data = {'url': img}
#Defining base url for API call.
base_url = "https://westcentralus.api.cognitive.microsoft.com/vision/v1.0/"
ocr_url = base_url + "ocr"
#Defining subscription key and headers for subscription key.
sub = "98f714r6vb2e193018b28fg1u9b3b0d7e7"
headers = {'Ocp-Apim-Subscription-Key': sub}