This file contains hidden or 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 idea was come from https://gist.github.com/jvanasco/1616707 | |
import types | |
def _var_dump(variable, depth = 0, not_new_line = False): | |
padding = " " * 4 * depth | |
key_padding = " " * 4 * (depth+1) | |
first_padding = '' if not_new_line else padding | |
not_new_line = True | |
depth+= 1 |
This file contains hidden or 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 cv2 | |
import numpy as np | |
c = cv2.VideoCapture(0) | |
# get the xmls from https://github.com/Itseez/opencv/tree/master/data/haarcascades | |
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_alt.xml') | |
eye_cascade = cv2.CascadeClassifier('haarcascade_eye.xml') | |
while(1): |
This file contains hidden or 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
string = ''' | |
<_> | |
<!-- root node --> | |
<feature> | |
<rects> | |
<_>3 7 14 4 -1.</_> | |
<_>3 9 14 2 2.</_></rects> | |
<tilted>0</tilted></feature> | |
<threshold>4.0141958743333817e-003</threshold> | |
<left_val>0.0337941907346249</left_val> |
This file contains hidden or 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
/* | |
* Gunvarrel v 0.0.1 | |
* Purpose: To emulate simple sonar robot | |
* Description: Far from perfect. I use LED instead of motor, and push-button instead of sonar | |
* Author: Go Frendi Gunawan | |
*/ | |
int left_motor = 12; // left motor (now just LED) | |
int right_motor = 13; // right motor (now just LED) | |
int sonar_sensor = 8; // sonar (now just push-button) |
This file contains hidden or 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
/* | |
* Gunvarrel v 0.0.2 | |
* Purpose: To emulate simple sonar robot | |
* Description: Far from perfect. I use LED instead of motor | |
* Author: Go Frendi Gunawan | |
*/ | |
int left_motor = 12; // left motor | |
int right_motor = 13; // right motor | |
int sonar_trig = 8; // sonar trigger | |
int sonar_echo = 7; // sonar echo |
This file contains hidden or 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
/* | |
* Gunvarrel v 0.0.3 | |
* Purpose: Simple sonar robot | |
* Description: Good enough | |
* Author: Go Frendi Gunawan | |
*/ | |
int left_motor = 11; // left motor | |
int right_motor = 10; // right motor | |
int sonar_trig = 12; // sonar trigger | |
int sonar_echo = 13; // sonar echo |
This file contains hidden or 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
<?php | |
// create curl resource | |
$ch = curl_init(); | |
// set url | |
curl_setopt($ch, CURLOPT_URL, "gofrendi.dev"); | |
//return the transfer as a string | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
This file contains hidden or 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
/* | |
* Gunvarrel v 0.0.5 | |
* Purpose: Sonar Robot with H-Bridge for smoother rotation | |
* Description: The robot will move to avoid obstacles | |
* Author: Go Frendi Gunawan | |
*/ | |
#include<NewPing.h> | |
int left_front = 6; // The ports |
This file contains hidden or 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 : Go Frendi Gunawan | |
# Purpose : Comparing Greedy & BruteForce Algorithm | |
''' | |
Graph Structures | |
''' | |
START, END = 'A', 'E' | |
COORDINATE = { | |
'A' : [0,1], | |
'B' : [2,0], |
This file contains hidden or 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
/* ledblink.c, an LED blinking program */ | |
#define F_CPU 1000000UL | |
#include<avr/io.h> | |
#include<util/delay.h> | |
void sleep(uint8_t millisec) | |
{ | |
while(millisec) | |
{ |