$ for i in `zcat numbers.txt.gz`; do redis-cli PFADD foo $i > /dev/null; done
$ redis-cli PFCOUNT foo
(integer) 1
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 JavaMain { | |
| public static void main(String args[]) { | |
| System.out.println("Hello, World"); | |
| } | |
| } | |
| // */ | |
| /*/**/ | |
| class App {} | |
| // */ |
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
| import bpy | |
| import math | |
| def delete_all(): | |
| for item in bpy.context.scene.objects: | |
| bpy.context.scene.objects.unlink(item) | |
| for item in bpy.data.objects: | |
| bpy.data.objects.remove(item) | |
| for item in bpy.data.meshes: | |
| bpy.data.meshes.remove(item) |
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
| def doSomething(strategy: String => Unit): Unit = { | |
| println("start") | |
| // call strategy | |
| strategy("SOME STRING") | |
| println("end") | |
| } | |
| def justPrint(s: String): Unit = println(s) |
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
| # Usage: | |
| ## cd /path/to/repository && ruby /path/to/repo_stat.rb | |
| files = `git grep --cached -Il ''`.chomp.split("\n") | |
| count_map = {} | |
| files.each do |file| | |
| ext = file.split(/[.\/]/).last | |
| count = `cat #{file.gsub(" ", "\\ ")} | wc -l | tr -d ' '`.chomp.to_i |
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
| implicit class CodePointOps(val self: String) extends AnyVal { | |
| // take | |
| def takeCodePoints(n: Int): String = { | |
| val itr = java.text.BreakIterator.getCharacterInstance | |
| itr.setText(self) | |
| val codePointCount = Iterator.continually(itr.next()).takeWhile(_ != java.text.BreakIterator.DONE).take(n).size |
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 net.ceedubs.ficus | |
| package readers | |
| import com.typesafe.config.ConfigFactory | |
| import net.ceedubs.ficus.Ficus._ | |
| import net.ceedubs.ficus.readers.EnumerationReader._ | |
| import net.ceedubs.ficus.readers.ArbitraryTypeReader._ | |
| import ConfigSerializerOps._ | |
| object CaseClassReadersSpec { |
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 com.example | |
| import org.apache.hadoop.fs.Path | |
| import org.apache.hadoop.io.{Text, NullWritable} | |
| import org.apache.hadoop.mapred.lib.MultipleTextOutputFormat | |
| import org.apache.spark.rdd.{PairRDDFunctions, RDD} | |
| import org.apache.spark.{SparkConf, SparkContext} | |
| case class PageView(accountId: Long, cookieId: String, timestamp: Long) |