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
git init . | |
git remote add origin [email protected]:0guzhan/review.git | |
git remote -v | |
git branch --set-upstream-to=origin/master master | |
git remote set-url origin [email protected]:0guzhan/review.git |
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 org.apache.commons.lang3.StringUtils; | |
import com.google.inject.Singleton; | |
import java.io.IOException; | |
import java.util.List; | |
import java.util.Random; | |
import javax.ws.rs.container.ContainerRequestContext; | |
import javax.ws.rs.container.ContainerRequestFilter; |
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
Bash File Testing | |
-b filename - Block special file | |
-c filename - Special character file | |
-d directoryname - Check for directory Existence | |
-e filename - Check for file existence, regardless of type (node, directory, socket, etc.) | |
-f filename - Check for regular file existence not a directory | |
-G filename - Check if file exists and is owned by effective group ID | |
-G filename set-group-id - True if file exists and is set-group-id | |
-k filename - Sticky bit |
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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use feature qw/say/; | |
my $sql_create_database = <<'SQL_CREATE_DATABASE'; | |
CREATE DATABASE IF NOT EXISTS database_name | |
DEFAULT CHARACTER SET = utf8mb4 | |
DEFAULT COLLATE utf8mb4_unicode_ci; |
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
/** | |
* calculates area of intersections of circles | |
* | |
* @param x1,y1,r1 first circle | |
* @param x2,y2,r2 second circle | |
*/ | |
public double solution(int x1, int y1, int r1, int x2, int y2, int r2) { | |
double sR1 = power(r1, 2); | |
double sR2 = power(r2, 2); | |
double d = distance(x1, y1, x2, y2); |
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
# running mysql docker container with port forwarding and setup root password | |
# while forwarding port right side is container port and left side is host port e.g. -p 80:5000 | |
sudo docker run --name demo-mysql-server2 -e MYSQL_ROOT_PASSWORD=password -d -p=3306:3306 mysql/mysql-server:5.7 | |
# docker-proxy process allocates port 3306 to forward traffic to container | |
sudo netstat -tulpn | grep 3306 | |
sudo docker port demo-mysql-server2 | |
# starting container |
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
/* | |
* Copyright 2016 oguzhan acargil | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
Stack<Vertex<T>> frontiers = new Stack<>(); | |
root.markFrontier(); | |
frontiers.push(root); | |
FRONTIERS: | |
while (!frontiers.isEmpty()) { | |
Vertex<T> current = frontiers.pop(); | |
List<Vertex<T>> successors = current.getSuccessors(); | |
for (Vertex<T> successor : successors) { | |
if (successor.isUndiscovered()) { |
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
/* | |
* Copyright 2016 oguzhan acargil | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
/* | |
* Copyright 2016 oguzhan acargil | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |