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
cmake_minimum_required(VERSION 2.8) | |
project(MPITest) | |
find_package(CUDA QUIET REQUIRED) | |
find_package(MPI REQUIRED) | |
if (MPI_FOUND) | |
include_directories(SYSTEM ${MPI_INCLUDE_PATH}) | |
else (MPI_FOUND) | |
message(SEND_ERROR "This application cannot compile without MPI") | |
endif (MPI_FOUND) | |
# Specify binary name and source file to build it from |
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
-- The graph data and algorithm source from the book "Mining of Massive Datasets", P175, http://infolab.stanford.edu/~ullman/mmds/book.pdf | |
-- This script has been verified the correctness in SQL Server 2017 Linux Version. | |
DROP TABLE Node; | |
DROP TABLE Edge; | |
DROP TABLE OutDegree; | |
DROP TABLE PageRank; | |
CREATE TABLE Node(id int PRIMARY KEY); | |
CREATE TABLE Edge(src int,dst int, PRIMARY KEY (src, dst)); | |
CREATE TABLE OutDegree(id int PRIMARY KEY, degree int); | |
CREATE TABLE PageRank(id int PRIMARY KEY, rank float); |
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
class Combinations { | |
/* | |
a b c | |
0 0 0 -> [] | |
0 0 1 -> [c] | |
0 1 0 -> [b] | |
... | |
1 1 0 -> [a b] | |
1 1 1 -> [a b c] | |
*/ |
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
/** | |
* select k'th smallest element | |
* @param nums the array to select | |
* @param k 0 <= k < |nums| | |
* @return k'th element | |
*/ | |
private int select(int[] nums, int k) { | |
int lo = 0, hi = nums.length - 1; | |
// If just one element, goto return directly; |
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
public class MatrixDFS { | |
int[] moveX = {0, 0, -1, 1}; | |
int[] moveY = {1, -1, 0, 0}; | |
boolean[][] visited; | |
public void search(int[][] matrix, int x, int y, String path) { | |
path += " -> " + y + "," + x; | |
if (y == 2 && x == 2) { | |
System.out.println(path); | |
System.out.println("--------------"); |
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
sudo apt-get install libmpc-dev | |
sudo apt install gcc-multilib | |
wget https://ftp.gnu.org/gnu/gcc/gcc-5.4.0/gcc-5.4.0.tar.gz | |
tar -zxvf gcc-5.4.0.tar.gz | |
cd gcc-5.4.0 | |
./configure --prefix=/opt/gcc-5.4.0 --enable-languages=c,c++ | |
make -j 8 | |
sudo make install |
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
[global] | |
netbios name = RASPBERRYPI | |
server string = The Raspberrypi File Center | |
workgroup = WORKGROUP | |
protocol = SMB3 | |
smb encrypt = auto | |
# allow follow soft links | |
follow symlinks = yes | |
wide links = yes | |
unix extensions = no |
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
#!/bin/bash | |
#set -e | |
# install-wifi - 19/10/2017 - by MrEngman. | |
UPDATE_SELF=${UPDATE_SELF:-1} | |
UPDATE_URI="http://downloads.fars-robotics.net/wifi-drivers/install-wifi" | |
ROOT_PATH=${ROOT_PATH:-"/"} | |
WORK_PATH=${WORK_PATH:-"${ROOT_PATH}/root"} |
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
class TestClass { | |
public: | |
enum MethodEnum { | |
METHOD_1, | |
METHOD_2, | |
METHOD_3 | |
}; | |
std::map<MethodEnum, std::function<void(void)>> method_map; |
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
url=https://***************/post_ip.php?ip= | |
while true | |
do | |
main_ipv4=`ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'|head -n 1` | |
main_ipv6=`ifconfig | awk '/inet6/{print $2}'|head -n 1` | |
curl -k $url"\"$main_ipv4-$main_ipv6\"" | |
sleep 5 | |
done | |
#crontab -e |
OlderNewer