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 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/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 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
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 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
(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 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
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 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
# Example using oacs-5-8 branch. | |
# tag first the desired branch | |
cvs checkout -r oacs-5-8 openacs-4 | |
cd openacs-4 | |
cvs tag -F vg-merge-oacs-5-8-date | |
# you can update the current checkout with | |
cvs up -A |
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
git log --format=%ae |sort | uniq -c| sort -nr| less |
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
#include <stdio.h> | |
int fun() { | |
int a = 1; | |
int *p = &a; | |
while (*p != 10) {p++;} | |
*p = 30; | |
return 0; | |
} |
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
#include <iostream> | |
#include <string> | |
template <bool B> | |
void Log(std::ostream& out, const std::string& str) { | |
if (B) { | |
out << str << "\n"; | |
} |
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
// Victor Guerra <[email protected]> | |
// 2014-09-26 | |
#include <cstdlib> | |
#include <cassert> | |
#include <iostream> | |
#include <algorithm> | |
#include <vector> | |
#include <numeric> |
NewerOlder