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
from collections import Counter | |
c = Counter() | |
with open('big_file.txt') as f: | |
for line in f: | |
c[line[:-1]] += 1 # Remove newline from line | |
for key, count in c.most_common(): | |
print(f'{key} - {count}') |
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
from typing import Generic, List, TypeVar | |
T = TypeVar('T') | |
class Container(Generic[T]): | |
def __init__(self, x: T): | |
self.x = x | |
def __repr__(self): | |
return f'<Container {self.x}>' |
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
// I'm not sure this is the minimal possible example, edits are welcome | |
package assertion; | |
import org.junit.Assert; | |
import org.junit.Before; | |
import org.junit.Rule; | |
import org.junit.Test; | |
import org.junit.rules.ExpectedException; | |
import org.junit.runner.RunWith; |
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
;; project.clj | |
(defproject mwe "0.0.1" | |
:dependencies [[org.clojure/clojure "1.7.0"] | |
[org.clojure/clojurescript "1.8.51"] | |
[compojure "1.4.0"] | |
[ring "1.1.6"] | |
[ring/ring-defaults "0.1.5"]] | |
:source-paths ["src/clj" "src/cljs"] | |
:plugins [[lein-ring "0.9.7"] |
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
˛∫æ 1 3 Call java/lang/Object call.ws <init> ()V | |