document = sc.textFile("hdfs:///user/user172/5000-8.txt")
wordCounts = document.flatMap(lambda line: line.split()).map(lambda word: (word, 1)).reduceByKey(lambda left, right: left + right)
wordCounts.saveAsTextFile("hdfs:///user/user172/tp/wordcount")
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
#!/usr/bin/awk -f | |
# This program is a copy of guff, a plot device. https://github.com/silentbicycle/guff | |
# My copy here is written in awk instead of C, has no compelling benefit. | |
# Public domain. @thingskatedid | |
# Run as awk -v x=xyz ... or env variables for stuff? | |
# Assumptions: the data is evenly spaced along the x-axis | |
# TODO: moving average |
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
diff --git a/utils/update_checkout/update_checkout/update_checkout.py b/utils/update_checkout/update_checkout/update_checkout.py | |
index 56e7ea24d4..54fcb18107 100755 | |
--- a/utils/update_checkout/update_checkout/update_checkout.py | |
+++ b/utils/update_checkout/update_checkout/update_checkout.py | |
@@ -117,17 +117,17 @@ def update_single_repository(pool_args): | |
except Exception: | |
pass | |
- if checkout_target: | |
- shell.run(['git', 'status', '--porcelain', '-uno'], |
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
(source_file | |
(top_level_code_decl | |
(brace_stmt | |
(defer_stmt | |
(func_decl implicit "$defer()" interface type='() -> ()' access=fileprivate | |
(parameter_list) | |
(brace_stmt | |
(call_expr type='()' location=../../../../examples/defer.swift:2:5 range=[../../../../examples/defer.swift:2:5 - line:2:28] nothrow arg_labels=_: | |
(declref_expr type='(Any..., String, String) -> ()' location=../../../../examples/defer.swift:2:5 range=[../../../../examples/defer.swift:2:5 - line:2:5] decl=Swift.(file).print(_:separator:terminator:) function_ref=single) | |
(tuple_shuffle_expr implicit type='(Any..., separator: String, terminator: String)' location=../../../../examples/defer.swift:2:11 range=[../../../../examples/defer.swift:2:10 - line:2:28] scalar_to_tuple elements=[-2, -1, -1] variadic_sources=[0] default_args_owner=Swift.(file).print(_:separator:terminator:) |
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
Latency Comparison Numbers | |
-------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
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
git ls-files -o | xargs git log -n 1 --diff-filter=D --format=format:%H -- |
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
chrpath -r ':/data/bin-exp/ns/lib::/data/bin-exp/tcl/lib' nsd |
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
# | |
# The contents of this file are subject to the Mozilla Public License | |
# Version 1.1 (the "License"); you may not use this file except in | |
# compliance with the License. You may obtain a copy of the License at | |
# http://www.mozilla.org/. | |
# | |
# Software distributed under the License is distributed on an "AS IS" | |
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See | |
# the License for the specific language governing rights and limitations | |
# under the License. |
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
#!/bin/sh | |
/bin/sleep 1 | |
export LANG=en_US.UTF8 | |
umask 002 | |
# NaviServer | |
#export LD_LIBRARY_PATH=/usr/local/ssl/lib64 | |
#export PATH=$PATH:/usr/local/pg/bin |
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
#!/bin/bash | |
# This script fetches automatically all needed packages | |
# to have an xowf application up and running. | |
# It dependes on the git-subtree utility ( which one can find |
NewerOlder