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
/** | |
* A FileBot (http://filebot.sourceforge.net) script that first renames the incoming file using the TiVo metadata | |
* then delegates to the rename() call of FileBot to translate the airdate of TV shows into an SXXEXX format. Movies | |
* should just pass through without change as long as we had a "movieYear" attribute in the metadata. | |
* | |
* To use from KMTTG, set something like this for your "Custom Command" and make sure your "metadata files" is set | |
* to "last". You should be able to use this strategy with encoded OR mpg files. Your file naming pattern within KMTTG | |
* shouldn't matter, but my setting is below. | |
* | |
* file naming value: |
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
/** | |
* search the (sorted) array for the indicated value | |
* | |
* @return index of the value or -1 when not found. | |
*/ | |
def search(arr, int val) { | |
int min = 0 | |
int max = arr.size() - 1 | |
while (max > min) { | |
int piv = Math.abs((min + max) / 2) |
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
package pbatch.rt.staging | |
import groovy.util.logging.Log4j | |
import net.sf.ehcache.Cache | |
import net.sf.ehcache.CacheManager | |
import net.sf.ehcache.Element | |
import net.sf.ehcache.config.CacheConfiguration | |
import net.sf.ehcache.store.MemoryStoreEvictionPolicy | |
import org.springframework.util.Assert | |
import pbatch.BatchId |
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 hudson.node_monitors.* | |
import hudson.slaves.* | |
import hudson.model.* | |
def hudson = Hudson.instance | |
hudson.slaves.findAll { it.name.startsWith("worker-") }.each { slave -> | |
println "\n\nExamining ${slave.name} workspaces ..." | |
def wsRoot = slave.getWorkspaceRoot() |
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 Tree { | |
private model = new HashMap<String, Set<String>>() | |
void add(String node, String dep) { | |
if (!model[node]) | |
model[node] = new HashSet<String>(); | |
model[node] << dep | |
} |
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
echo '2^2^20' | time bc > /dev/null |
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
SELECT | |
'grant '||DECODE(object_type,'TABLE','select,insert,delete,update ','VIEW', | |
'select,insert,delete,update ','SEQUENCE','SELECT ','PROCEDURE','EXECUTE ','PACKAGE','EXECUTE ' | |
,'TRIGGER','EXECUTE ','FUNCTION','EXECUTE ')|| ' on '||owner||'.'||object_name|| | |
' to xpappusr;' | |
FROM | |
dba_objects | |
WHERE | |
OWNER='ODMT' | |
AND object_type IN ('TABLE', |
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
/** | |
* Writes the {@link Encounter}s into the specified avro file. | |
*/ | |
void write(List<Encounter> encounters, Path output) { | |
AvroKeyValue<EncounterKey, Encounter> kvRecord = | |
new AvroKeyValue<EncounterKey, Encounter>(new GenericData.Record(schemaEncounterKv)) | |
DataFileWriter<GenericRecord> fileWriter = | |
new DataFileWriter<GenericRecord>(dataModel.createDatumWriter(schemaEncounterKv)) |
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
def tomorrow = new Date() + 1 | |
use (TimeCategory) { | |
def appointment = now + 1.week + 1.days + 15.hours + 10.minutes | |
def monday = new Date().with { it.clearTime(); it - it.calendarDate.dayOfWeek } | |
def recurringWeeklyForYear = (1..52).collect { monday + it.weeks } | |
} |
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
# Call with a machine name to load the environment for that machine. Called | |
# without a machine name it will load a ~/.docker_env file into the shell | |
# environment and into launchctl | |
# | |
# Added a new var to the mix - DOCKER_HOST_IP | |
function useDockerMachine() { | |
if [ $# -eq 0 ]; then | |
if [ ! -f ~/.docker_env ]; then | |
>&2 printf "Error: No ~/.docker_env file exists. Specify machine to use.\n" | |
return |
OlderNewer