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
/** | |
* Read the blog post here, for better under standing, | |
* https://computopedia.com/how-to-convert-image-to-binary-nodejs | |
*/ | |
const getBinary = async (params = undefined) => { | |
/** | |
* @auther: Shankha | |
* @date: 26 Apr, 2020 | |
*/ |
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
const getBinary = async (params = undefined) => { | |
/** | |
* @auther: Shankha | |
* @date: 26 Apr, 2020 | |
*/ | |
// params format: | |
// getBinary({ | |
// path : '<file_relative_path>', | |
// padlength: '<prepending_padding_length>', (Default: 4) |
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 { Injectable } from '@angular/core'; | |
import { endpoints } from './endpoints'; | |
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; | |
import { environment } from 'src/environments/environment'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class ApiService { | |
constructor(private http: HttpClient) { } |
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 { environment } from 'src/environments/environment' | |
export const endpoints = { | |
request: { | |
GetAuthToken: { | |
method: 'post', | |
url: '/oauth/token', | |
token: { | |
is_needed: true, | |
type: 'Basic' |
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
<?php | |
// DATABASE SETTINGS // CHANGE THESE TO YOUR OWN !! | |
define('DB_HOST', 'localhost'); | |
define('DB_NAME', 'computopedia_test_db'); | |
define('DB_CHARSET', 'utf8'); | |
define('DB_USER', 'computopedia'); | |
define('DB_PASSWORD', ''); | |
?> |
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
Selector:= white | |
Foreach black tile b | |
do h(b):= tile-distance to the first white tile to its right | |
Foreach white tile w | |
do h(w):= tile-distance to the first black tile to its left * -1 | |
While any tile has a non-zero h value | |
Do | |
If selector:= white then, | |
Select the while-tile with the highest h value, say X |