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
#!/bin/bash | |
# | |
# Put me in cron.daily, cron.hourly or cron.d for your own custom schedule | |
# Running daily? You'll keep 3 daily backups | |
# Running hourly? You'll keep 3 hourly backups | |
NUM_BACKUPS_TO_KEEP=3 | |
# Who wants to know when the backup failed, or | |
# when the binary logs didn't get applied |
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
#!/bin/bash | |
NL=$'\n' | |
#EXP='DISK WARNING|DISK OK' | |
OK="DISK OK" | |
WARNING="DISK WARNING" | |
CRITICAL="DISK CRITICAL" |
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
#!/bin/bash | |
# Usage: clusterctl start|stop | |
# | |
# Launches a local RabbitMQ cluster | |
# | |
# The name returned by `hostname -s` must resolve to 127.0.0.1 | |
CLUSTER_SIZE=4 | |
NODENAME_PREFIX='rmq' |
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
class SortedArray { | |
static boolean ispresent(int[] a, int i) { | |
return i == find(a, 0, a.length - 1, i); | |
} | |
static int find(int[] a, int low, int high, int i) { | |
int m = low + (high - low) / 2; | |
if (i == a[m]) |
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 java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.List; | |
public class TarjanOfflineLCA { | |
void LCA(Node u) { | |
MakeSet(u); | |
Find(u).ancestor = u; |
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
1. include the following two jaascript | |
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script> | |
<script src="https://raw.githubusercontent.com/caot/battatech_excelexport/master/Scripts/jquery.battatech.excelexport.js"></script> | |
2. Add the folling behind the targeted table with id = "tblExport" | |
<script> | |
$(document).ready(function () { | |
$("#btnExport").click(function () { |
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
#! /bin/env tclsh | |
proc clean {infilename outfilename} { | |
set delimiter "|" | |
set char_to_be_removed "^" | |
set newline "\x0d" | |
set infile [open $infilename r] | |
set outfile [open $outfilename "w"] |
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 following Randomized solution can be found anywhere. | |
QuickSelect: Given array A of size n and integer k ≤ n, | |
1. Pick a pivot element p at random from A. | |
2. Split A into subarrays LESS and GREATER by comparing each element to p as in | |
Quicksort. While we are at it, count the number L of elements going in to LESS. | |
3. (a) If L = k − 1, then output p. | |
(b) If L > k − 1, output QuickSelect(LESS, k). | |
(c) If L < k − 1, output QuickSelect(GREATER, k − L − 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
c++ | |
long result = getByte() & 0xFF; | |
result |= (getByte() & 0xFF) << 8; | |
result |= (getByte() & 0xFF) << 16; | |
result |= (getByte() & 0xFF) << 24; | |
result |= (getByte() & 0xFF) << 32; | |
result |= (getByte() & 0xFF) << 40; | |
result |= (getByte() & 0xFF) << 48; | |
result |= (getByte() & 0xFF) << 56; | |
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
#!/bin/bash | |
# | |
# Using the information available in the new iOS8 simulator for each | |
# device/runtime (device.plist), this script creates a readable folder structure | |
# (no UDIDs, just simple device/runtime names). Inside that structure it creates | |
# soft links to your apps in development. | |
# | |
# You can run this script every time you install an app to your simulator, or | |
# you can simply call it to access this folder making sure it will always be | |
# updated :) |
OlderNewer