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
{"lastUpload":"2020-04-11T04:02:35.858Z","extensionVersion":"v3.4.3"} |
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/python | |
import sys | |
import os | |
class IParser: | |
def __init__(): | |
pass | |
def parse(self, doc, out_file): |
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
// Instead of adding argument --files /apache/hbase/conf/hbase-site.xml, just copy `hbase-site.xml` to /apache/spark/conf/ | |
//spark-shell --executor-memory 20g --executor-cores 1 --num-executors 10 --driver-memory 8g --queue $HADOOP_QUEUE --jars $(for x in `ls -1 /apache/hbase/lib/*.jar`; do readlink -f $x; done | paste -s | sed -e 's/\t/,/g') | |
import java.io.{DataOutputStream, ByteArrayOutputStream} | |
import org.apache.hadoop.hbase.client.Scan | |
import org.apache.hadoop.hbase.HBaseConfiguration | |
import org.apache.hadoop.hbase.io.ImmutableBytesWritable | |
import org.apache.hadoop.hbase.client.Result | |
import org.apache.hadoop.hbase.mapreduce.TableInputFormat | |
import org.apache.hadoop.hbase.util.Base64 |
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
set mapred.job.queue.name=hddq-commrce-mktmisc; | |
set hive.auto.convert.sortmerge.join=true; | |
set hive.optimize.bucketmapjoin=true; | |
set hive.optimize.bucketmapjoin.sortedmerge=true; | |
set hive.auto.convert.sortmerge.join.noconditionaltask=true; | |
set hive.enforce.bucketing=true; | |
set hive.enforce.sorting=true; | |
drop table IF EXISTS pla_bucket_superset; |
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 Solution { | |
public int solution(int A, int B, int K) { | |
return B == 0 ? 1 : (B / K - (A == 0 ? -1 : (A-1) / K )); | |
} | |
} |
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
// you can also use imports, for example: | |
import java.util.*; | |
class Solution { | |
public int solution(int[] A) { | |
// search for max integer | |
int max = 0; | |
for (int a : A) { | |
// skip negative integers | |
if (a <= 0) { continue; } |
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 { | |
import flash.errors.IOError; | |
import flash.events.ErrorEvent; | |
import flash.events.Event; | |
import flash.events.IOErrorEvent; | |
import flash.events.ProgressEvent; | |
import flash.events.SecurityErrorEvent; | |
import flash.net.Socket; | |
import flash.system.Security; |
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 controllers | |
import java.util.Properties | |
import com.typesafe.config.ConfigFactory | |
import kafka.consumer.{Consumer, ConsumerConfig, ConsumerConnector, Whitelist} | |
import kafka.serializer.StringDecoder | |
import play.api.libs.iteratee.{Enumerator, Iteratee} | |
import play.api.mvc.{Controller, WebSocket} |
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 | |
# Install parallel on CentOS 6. | |
# Assumes you are root. Prefix w/ sudo if not. | |
cd /etc/yum.repos.d/ | |
#wget http://download.opensuse.org/repositories/home:tange/CentOS_CentOS-5/home:tange.repo | |
wget http://download.opensuse.org/repositories/home:/tange/CentOS_CentOS-6/home:tange.repo | |
yum install parallel |
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
// insert | |
void minHeapUp(int[] arr, int i) { | |
int j = (i - 1) / 2; // parent index | |
int tmp = arr[i]; | |
while (j >= 0 && i != 0) { | |
if (arr[j] <= arr[i]) { | |
break; | |
} | |
arr[i] = arr[j]; | |
i = j; |