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
#define OPENCL_PLATFORM_UNKNOWN 0 | |
#define OPENCL_PLATFORM_AMD 1 | |
#define OPENCL_PLATFORM_CLOVER 2 | |
#define OPENCL_PLATFORM_NVIDIA 3 | |
#define OPENCL_PLATFORM_INTEL 4 | |
#ifdef cl_clang_storage_class_specifiers | |
#pragma OPENCL EXTENSION cl_clang_storage_class_specifiers : enable | |
#endif |
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
package kxi.rpc.test.basic; | |
class MergeSortSolution { | |
private static void merge(int arr[], int left, int mid, int right) { | |
int leftCount = mid - left + 1; | |
int rightCount = right - mid; | |
int leftArr[] = new int[leftCount]; | |
int rightArr[] = new int[rightCount]; |
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
function exe_cmd() { | |
echo $1 | |
eval $1 | |
} | |
function ensure_dir() | |
{ | |
if [ ! -d $1 ]; then | |
exe_cmd "mkdir -p $1" | |
fi |
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
sourceServer=172.16.1.121 | |
function syncusers() { | |
scp $sourceServer:/etc/passwd /tmp/passwd.$sourceServer | |
scp $sourceServer:/etc/group /tmp/group.$sourceServer | |
scp $sourceServer:/etc/shadow /tmp/shadow.$sourceServer | |
# First, make a list of non-system users that need to be moved. | |
local UGIDLIMIT=500 |
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 ImageUrlManager { | |
private static final String HTTP = "http"; | |
private static final String GIF = ".gif"; | |
private static final String KEY_IMAGEMOGR2 = "?imageMogr2"; | |
/** | |
* Refer to: https://portal.qiniu.com/myTickets/ticketDetail?id=36037 | |
* There is one bug in qiniu.com, they may fail to convert gif to |
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
# using route | |
route del default gw 192.168.0.1 | |
route add default gw 192.168.0.4 | |
# or using ip | |
ip route del default | |
ip route add default via 192.168.0.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
var list = document.getElementsByClassName('pl-video-time'); | |
var time = 0; | |
function toS(hms) { | |
var a = hms.split(':'); | |
while (a.length < 3) { | |
a.unshift(0); | |
} | |
var seconds = (+a[0]) * 60 * 60 + (+a[1]) * 60 + (+a[2]); | |
return seconds; |