cricket_007

1

votes
2

answer
62

views

Files.walkFileTree in lexicographical order

I have a unit test that is trying to mock reading an S3 bucket using the local filesystem. To do that, I am utilizing Files.walkFileTree to just add certain records to a list. Here's the folder that is being walked, and I am later extracting the data out of the .gz files. $ ls -l /var/folders/8g/f...
cricket_007
1

votes
1

answer
574

views

Calculating row-wise delta values in a DataFrame

I'm trying to calculate what I am calling 'delta values', meaning the amount that has changed between two consecutive rows. For example A | delta_A 1 | 0 2 | 1 5 | 3 9 | 4 I managed to do that starting with this code (basically copied from a MatLab program I had) df = df.assign(delta_A=np.zeros...
cricket_007
2

votes
1

answer
744

views

Android Uri.Builder using “/” instead of “//” after scheme

I dug through the source code, but I just can't find a reason for this behavior. According to Use URI builder in Android or create URL with variables, this should work absolutely fine. Say I want to connect to https://www.gravatar.com/eac16c9fc481cb6825f8b3a35f916b5c.json Then, I have this code to...
cricket_007
3

votes
2

answer
195

views

Why doesn't Pattern.pattern() embed the flag(s)?

I've been playing around with regexes recently and noticed this. Pattern pNoEmbed = Pattern.compile('[ a-z]+', Pattern.CASE_INSENSITIVE); Pattern pEmbed = Pattern.compile('(?i)[ a-z]+'); Here's the output of the pattern() methods that is supposed to return the string of the pattern. And toString()...
cricket_007
2

votes
1

answer
87

views

'new HiveContext' is wanting an X11 display? com.trend.iwss.jscan?

Spark 1.6.2 (YARN master) Package name: com.example.spark.Main Basic SparkSQL code val conf = new SparkConf() conf.setAppName('SparkSQL w/ Hive') val sc = new SparkContext(conf) val hiveContext = new HiveContext(sc) import hiveContext.implicits._ // val rdd = val df = rdd.toDF() df.write.saveAsTab...
cricket_007
5

votes
4

answer
3.7k

views

Missing hive-site when using spark-submit YARN cluster mode

Using HDP 2.5.3 and I've been trying to debug some YARN container classpath issues. Since HDP includes both Spark 1.6 and 2.0.0, there have been some conflicting versions Users I support are successfully able to use Spark2 with Hive queries in YARN client mode, but not from cluster mode they get er...
cricket_007
3

votes
2

answer
1.8k

views

Gradle - What is a non-zero exit value and how do I fix it?

I am developing an Android application, and every time I run it, I get this message: :module:someTask FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':module:someTask'. > some message here... finished with non-zero exit value X * Try: Run with --stacktr...
cricket_007
4

votes
1

answer
400

views

Handling duplicate regex group name in Java (C# translation)

I am trying to translate a section of C# code into Java, and while I have familiarity in both, I am not very strong with the regex libraries. From MSDN, they give this example String pattern = @'\D+(?\d+)\D+(?\d+)?'; And this output (which I see they are using the capture index, and not the group na...
cricket_007